summaryrefslogtreecommitdiffstats
path: root/lib/git/branch.rb
blob: cc33970925a4866f7ae5d27e5d208635f51ca5c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Git
  class Branch < Path
    
    attr_accessor :full, :remote, :name, :current, :commit
    
    @base = nil
    
    def initialize(base, name, current = false)
      @remote = nil
      @full = name
      @base = base
      @commit = @base.object(name)
      @current = current
      
      parts = name.split('/')
      if parts[1]
        @remote = Git::Remote.new(@base, parts[0])
        @name = parts[1]
      else
        @name = parts[0]
      end
    end
    
  end
end