summaryrefslogtreecommitdiffstats
path: root/lib/git/branch.rb
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-09 13:11:22 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-09 13:11:22 -0800
commit9d59d2965184964ab6662282ef5f9ceac2c58552 (patch)
treef8dd8bf4004eb9403f9ffe2b5c5c708ef877895a /lib/git/branch.rb
parentab20a674e50268b6c541949c746d77b16a26d15c (diff)
downloadthird_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.tar.gz
third_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.tar.xz
third_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.zip
added branches, more log stuff, better tests, changed the log api a bit
added tests for Git::Lib, started Git::Diff development
Diffstat (limited to 'lib/git/branch.rb')
-rw-r--r--lib/git/branch.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/git/branch.rb b/lib/git/branch.rb
index 8f8953b..cc33970 100644
--- a/lib/git/branch.rb
+++ b/lib/git/branch.rb
@@ -1,10 +1,24 @@
module Git
class Branch < Path
+ attr_accessor :full, :remote, :name, :current, :commit
+
@base = nil
- def initialize(base, name)
+ 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