Add a method for getting the repo HEAD
This commit is contained in:
parent
c904c71792
commit
4c05d411f3
@ -44,10 +44,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def head
|
def head
|
||||||
head = HOMEBREW_REPOSITORY.cd do
|
Homebrew.git_head || "(none)"
|
||||||
`git rev-parse --verify -q HEAD 2>/dev/null`.chomp
|
|
||||||
end
|
|
||||||
if head.empty? then "(none)" else head end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def origin
|
def origin
|
||||||
|
|||||||
@ -14,10 +14,6 @@ class Tab < OpenStruct
|
|||||||
build = f.build.dup
|
build = f.build.dup
|
||||||
build.args = args
|
build.args = args
|
||||||
|
|
||||||
sha = HOMEBREW_REPOSITORY.cd do
|
|
||||||
`git rev-parse --verify -q HEAD 2>/dev/null`.chuzzle
|
|
||||||
end
|
|
||||||
|
|
||||||
Tab.new :used_options => build.used_options,
|
Tab.new :used_options => build.used_options,
|
||||||
:unused_options => build.unused_options,
|
:unused_options => build.unused_options,
|
||||||
:tabfile => f.prefix.join(FILENAME),
|
:tabfile => f.prefix.join(FILENAME),
|
||||||
@ -25,7 +21,7 @@ class Tab < OpenStruct
|
|||||||
:poured_from_bottle => false,
|
:poured_from_bottle => false,
|
||||||
:tapped_from => f.tap,
|
:tapped_from => f.tap,
|
||||||
:time => Time.now.to_i,
|
:time => Time.now.to_i,
|
||||||
:HEAD => sha,
|
:HEAD => Homebrew.git_head,
|
||||||
:compiler => compiler,
|
:compiler => compiler,
|
||||||
:stdlib => stdlib
|
:stdlib => stdlib
|
||||||
end
|
end
|
||||||
|
|||||||
@ -112,6 +112,10 @@ module Homebrew
|
|||||||
Process.wait(pid)
|
Process.wait(pid)
|
||||||
$?.success?
|
$?.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.git_head
|
||||||
|
HOMEBREW_REPOSITORY.cd { `git rev-parse --verify -q HEAD 2>/dev/null`.chuzzle }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_system_path
|
def with_system_path
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user