class Disloku::Git::Repository

Public Class Methods

new(location) click to toggle source
Calls superclass method Disloku::Repository::new
# File lib/disloku/git/Repository.rb, line 8
def initialize(location)
        super(location)
end

Public Instance Methods

getBranchName() click to toggle source
# 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) click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/disloku/git/Repository.rb, line 40
def getProvider()
        return ChangeSetProvider.new(self)
end
getRepositoryRoot() click to toggle source
# File lib/disloku/git/Repository.rb, line 12
def getRepositoryRoot()
        old = Dir.pwd()
        Dir.chdir(location)
        status = SysCmd.new("git rev-parse --show-toplevel").execute()
        Dir.chdir(old)

        return status.output.strip()
end