Sha256: 6c7734e2ec546d87a87545c70e176b5cd3b59ef9af94620a8f6a9c512b784b31
Contents?: true
Size: 552 Bytes
Versions: 5
Compression:
Stored size: 552 Bytes
Contents
module Codacy class Git def self.commit_id commit = ENV['TRAVIS_COMMIT'] || ENV['DRONE_COMMIT'] || ENV['GIT_COMMIT'] || ENV['CIRCLE_SHA1'] || ENV['CI_COMMIT_ID'] || ENV['WERCKER_GIT_COMMIT'] || git_commit commit end def self.git_commit git("log -1 --pretty=format:'%H'") end def self.git_dir return `git rev-parse --show-toplevel`.strip! end def self.git(command) `git --git-dir="#{git_dir}/.git" #{command}` end end end
Version data entries
5 entries across 5 versions & 1 rubygems