Class: Disloku::Git::Repository
- Inherits:
-
Repository
- Object
- Repository
- Disloku::Git::Repository
- Defined in:
- lib/disloku/git/Repository.rb
Instance Attribute Summary
Attributes inherited from Repository
Instance Method Summary collapse
- #getBranchName ⇒ Object
- #getHashOfRefspec(refspec) ⇒ Object
- #getHeadHash ⇒ Object
- #getProvider ⇒ Object
- #getRepositoryRoot ⇒ Object
-
#initialize(location) ⇒ Repository
constructor
A new instance of Repository.
Methods inherited from Repository
Constructor Details
#initialize(location) ⇒ Repository
Returns a new instance of Repository.
8 9 10 |
# File 'lib/disloku/git/Repository.rb', line 8 def initialize(location) super(location) end |
Instance Method Details
#getBranchName ⇒ Object
21 22 23 24 25 26 |
# File 'lib/disloku/git/Repository.rb', line 21 def getBranchName() return @branch || begin branch = SysCmd.new("git --git-dir=\"#{@gitDir}\" rev-parse --abbrev-ref HEAD").execute() @branch = branch.output.strip() end end |
#getHashOfRefspec(refspec) ⇒ Object
28 29 30 31 |
# File 'lib/disloku/git/Repository.rb', line 28 def getHashOfRefspec(refspec) hash = SysCmd.new("git --git-dir=\"#{@gitDir}\" rev-parse #{refspec}").execute() return hash.output.strip() end |
#getHeadHash ⇒ Object
33 34 35 36 37 38 |
# File 'lib/disloku/git/Repository.rb', line 33 def getHeadHash() return @headHash || begin headHash = SysCmd.new("git --git-dir=\"#{@gitDir}\" rev-parse HEAD").execute() @headHash = branch.output.strip() end end |
#getProvider ⇒ Object
40 41 42 |
# File 'lib/disloku/git/Repository.rb', line 40 def getProvider() return ChangeSetProvider.new(self) end |