Sha256: 21cc120c5d76b00b3faf59a3797a63cd25b0798baf8b919398acc8b453e8ece9

Contents?: true

Size: 628 Bytes

Versions: 5

Compression:

Stored size: 628 Bytes

Contents

difficulty 3

description "A file has been modified, but you don't want to keep the files.  Checkout the `config.rb` file from the last commit."

setup do
  repo.init
  File.open("config.rb", "w") do |file|
    file.puts("This is the initial config file")
  end

  repo.add("config.rb")
  repo.commit_all("Added initial config file")

  File.open("config.rb", "a") do |file|
    file.puts("These are changed you don't want to keep!")
  end
end

solution do
  repo.status.files["config.rb"].type != "M" && repo.commits.length == 1
end

hint do
  puts "You will need to do some research on the checkout command for this one."
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
githug-0.2.7 levels/checkout_file.rb
githug-0.2.6 levels/checkout_file.rb
githug-0.2.5 levels/checkout_file.rb
githug-0.2.4 levels/checkout_file.rb
githug-0.2.3 levels/checkout_file.rb