Sha256: 8dff23755de75606164e98359410998a3f2204766639280824770d797614a3f8

Contents?: true

Size: 521 Bytes

Versions: 1

Compression:

Stored size: 521 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 Dir.pwd
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codacy-coverage-0.2.0 lib/codacy/git.rb