Created
October 9, 2014 13:07
-
-
Save kolo/614786f752358430c66d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Builds::Git | |
def self.check_sha(sha, treeish) | |
Dir.chdir(Settings.git.path) do | |
out = `git log #{treeish} | grep #{sha}` | |
if out.strip.empty? | |
out = `git rev-list --cherry-mark master...#{treeish} | grep '#{sha}'` | |
if out.strip == "=#{sha}" | |
return true | |
elsif out.strip.empty? | |
out = `git rev-list --cherry-mark TM...#{treeish} | grep '#{sha}'` | |
if out.strip == "=#{sha}" | |
return true | |
end | |
end | |
else | |
return true | |
end | |
false | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment