Sha256: c2ae98131510a6a97bbec2006f7928b699c71a2fc372856c5e9d7c085f5c0d6b

Contents?: true

Size: 801 Bytes

Versions: 12

Compression:

Stored size: 801 Bytes

Contents

difficulty 3
description "You forgot to branch at the previous commit and made a commit on top of it. Create branch 'test_branch' at the commit before the last" 

setup do
  repo.init
  FileUtils.touch("file1")
  repo.add("file1")
  repo.commit_all("Adding file1")
  File.open("file1", 'w') { |f| f.write("content") }
  repo.add("file1")
  repo.commit_all("Updating file1")
  File.open("file1", 'a') { |f| f.write("\nAdding some more text") }
  repo.add("file1")
  repo.commit_all("Updating file1 again")
end

solution do
  return false unless repo.branches.map(&:name).include?("test_branch")
  repo.commits("test_branch").each { |commit| return false if commit.message ==  "Updating file1 again" }
  true
end

hint do
  puts "Just like creating a branch, but you have to pass an extra argument"
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
githug-0.2.11 levels/branch_at.rb
githug-0.2.10 levels/branch_at.rb
githug-0.2.9 levels/branch_at.rb
githug-0.2.8 levels/branch_at.rb
githug-0.2.7 levels/branch_at.rb
githug-0.2.6 levels/branch_at.rb
githug-0.2.5 levels/branch_at.rb
githug-0.2.4 levels/branch_at.rb
githug-0.2.3 levels/branch_at.rb
githug-0.2.2 levels/branch_at.rb
githug-0.2.1 levels/branch_at.rb
githug-0.2.0 levels/branch_at.rb