added branches, more log stuff, better tests, changed the log api a bit
[rubygit.git] / lib / git / branch.rb
blobcc33970925a4866f7ae5d27e5d208635f51ca5c9
1 module Git
2   class Branch < Path
3     
4     attr_accessor :full, :remote, :name, :current, :commit
5     
6     @base = nil
7     
8     def initialize(base, name, current = false)
9       @remote = nil
10       @full = name
11       @base = base
12       @commit = @base.object(name)
13       @current = current
14       
15       parts = name.split('/')
16       if parts[1]
17         @remote = Git::Remote.new(@base, parts[0])
18         @name = parts[1]
19       else
20         @name = parts[0]
21       end
22     end
23     
24   end
25 end