4 attr_accessor :full, :remote, :name
9 def initialize(base, name)
14 parts = name.split('/')
16 @remote = Git::Remote.new(@base, parts[0])
24 @gcommit = @base.gcommit(@full) if !@gcommit
33 def archive(file, opts = {})
34 @base.lib.archive(@full, file, opts)
37 # g.branch('new_branch').in_branch do
40 # return true # auto commits and switches back
42 def in_branch (message = 'in branch work')
43 old_current = @base.lib.branch_current
46 @base.commit_all(message)
50 @base.checkout(old_current)
58 @base.lib.branch_delete(@name)
65 def merge(branch = nil, message = nil)
68 @base.merge(branch, message)
71 # merge a branch into this one
73 # merge this branch into the current one
78 def update_ref(commit)
79 @base.lib.update_ref(@full, commit)
93 @base.lib.branch_new(@name) rescue nil
97 @base.lib.branch_current == @name