module GitHubStatus::Support::Git

Public Instance Methods

git() click to toggle source
# File lib/github-status/support/git.rb, line 11
def git
  @git ||= ::Git.open "#{workdir}/#{path}"
rescue ArgumentError
  STDERR.puts "#{path} is not a git repository"
  abort
end
sha() click to toggle source
# File lib/github-status/support/git.rb, line 19
def sha
  @sha ||= if File.file? "#{workdir}/#{path}"
    File.read("#{workdir}/#{path}").chomp
  else
    git.revparse 'HEAD'
  end
end