Method: Git::Branch#in_branch
- Defined in:
- lib/git/branch.rb
#in_branch(message = 'in branch work')
g.branch('new_branch').in_branch do # create new file # do other stuff return true # auto commits and switches back end
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/git/branch.rb', line 38 def in_branch( = 'in branch work') old_current = @base.lib.branch_current checkout if yield @base.commit_all() else @base.reset_hard end @base.checkout(old_current) end |