Sha256: 06a3919946ce344e0bd56ffd2f56d186e3b5b03583613d0389c6f388eb3ee19f

Contents?: true

Size: 635 Bytes

Versions: 22

Compression:

Stored size: 635 Bytes

Contents

difficulty 3

description "A file has been modified, but you don't want to keep the modification.  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

22 entries across 22 versions & 2 rubygems

Version Path
mygithug-0.5.1 levels/checkout_file.rb
githug-0.5.0 levels/checkout_file.rb
githug-0.4.8 levels/checkout_file.rb
githug-0.4.7 levels/checkout_file.rb
githug-0.4.6 levels/checkout_file.rb
githug-0.4.5 levels/checkout_file.rb
githug-0.4.4 levels/checkout_file.rb
githug-0.4.3 levels/checkout_file.rb
githug-0.4.2 levels/checkout_file.rb
githug-0.4.1 levels/checkout_file.rb
githug-0.4.0 levels/checkout_file.rb
githug-0.3.5 levels/checkout_file.rb
githug-0.3.4 levels/checkout_file.rb
githug-0.3.3 levels/checkout_file.rb
githug-0.3.2 levels/checkout_file.rb
githug-0.3.1 levels/checkout_file.rb
githug-0.3.0 levels/checkout_file.rb
githug-0.2.12 levels/checkout_file.rb
githug-0.2.11 levels/checkout_file.rb
githug-0.2.10 levels/checkout_file.rb