Module: Dockly::Util::Git

Extended by:
Git
Included in:
Git
Defined in:
lib/dockly/util/git.rb

Instance Method Summary collapse

Instance Method Details

#git_repoObject



6
7
8
# File 'lib/dockly/util/git.rb', line 6

def git_repo
  @git_repo ||= Grit::Repo.new('.')
end

#git_shaObject



10
11
12
# File 'lib/dockly/util/git.rb', line 10

def git_sha
  @git_sha ||= git_repo.git.show.lines.first.chomp.match(/^commit ([a-f0-9]+)$/)[1][0..6] rescue 'unknown'
end