Sha256: c6fe698cec5bcf201da0fcb3d977aaace48dfd6d5e572b261e3bcd11bf40ecbf

Contents?: true

Size: 534 Bytes

Versions: 2

Compression:

Stored size: 534 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

    private

    def self.git_commit
      git("log -1 --pretty=format:'%H'")
    end

    def self.git_dir
      return Dir.pwd
    end

    def self.git(command)
      `git --git-dir="#{git_dir}/.git" #{command}`
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
codacy-coverage-0.1.0 lib/codacy/git.rb
codacy-coverage-0.0.1 lib/codacy/git.rb