Sha256: 6ef8965d6640180a5d8e14a5492fa6c6c8bbd0a00c7370406f77c4c0913a32a2

Contents?: true

Size: 873 Bytes

Versions: 16

Compression:

Stored size: 873 Bytes

Contents

difficulty 2
description "There are two files to be committed.  The goal was to add each file as a separate commit, however both were added by accident.  Unstage the file `to_commit_second` using the reset command (don't commit anything)"

setup do
  repo.init
  FileUtils.touch("README")
  repo.add("README")
  repo.commit_all("Initial commit")
  FileUtils.touch("to_commit_first.rb")
  FileUtils.touch("to_commit_second.rb")
  repo.add(".")
end

solution do
  return false unless (repo.status.files["to_commit_second.rb"].nil? || repo.status.files["to_commit_second.rb"].stage.nil?) && File.exists?("to_commit_second.rb")
  return false if (repo.status.files["to_commit_first.rb"].nil? || repo.status.files["to_commit_first.rb"].stage.nil?)
  true
end

hint do
  puts "You can get some useful information for git status, it will tell you the command you need to run"
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
githug-0.3.3 levels/reset.rb
githug-0.3.2 levels/reset.rb
githug-0.3.1 levels/reset.rb
githug-0.3.0 levels/reset.rb
githug-0.2.12 levels/reset.rb
githug-0.2.11 levels/reset.rb
githug-0.2.10 levels/reset.rb
githug-0.2.9 levels/reset.rb
githug-0.2.8 levels/reset.rb
githug-0.2.7 levels/reset.rb
githug-0.2.6 levels/reset.rb
githug-0.2.5 levels/reset.rb
githug-0.2.4 levels/reset.rb
githug-0.2.3 levels/reset.rb
githug-0.2.2 levels/reset.rb
githug-0.2.1 levels/reset.rb