repo.or.cz
/
rubygit.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
changed .commit to .gcommit for consistency
[rubygit.git]
/
lib
/
git
/
branch.rb
blob
bf4d80a47c46b9c7641d405bc1ac1ff9688ac513
1
module Git
2
class Branch < Path
3
4
attr_accessor :full, :remote, :name, :current
5
6
@base = nil
7
@gcommit = nil
8
9
def initialize(base, name, current = false)
10
@remote = nil
11
@full = name
12
@base = base
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
def gcommit
25
@gcommit = @base.object(name) if !@gcommit
26
@gcommit
27
end
28
29
end
30
end