Skip to content

Commit

Permalink
Update commit when resolving the formula (Homebrew#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladshablinsky authored and xu-cheng committed Jul 17, 2016
1 parent 2633f88 commit 092d471
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Library/Homebrew/extend/ARGV.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def resolved_formulae
resolved_spec = spec(nil) || tab.spec
f.set_active_spec(resolved_spec) if f.send(resolved_spec)
f.build = tab
if f.head? && tab.tabfile
k = Keg.new(tab.tabfile.parent)
f.version.update_commit(k.version.version.commit)
end
end
f
else
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/formulary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def self.from_keg(keg, spec = nil)
end
end
f.build = tab
f.version.update_commit(keg.version.version.commit) if f.head?
f
end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/postinstall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

trap("INT", old_trap)

formula = ARGV.formulae.first
formula = ARGV.resolved_formulae.first
formula.extend(Debrew::Formula) if ARGV.debug?
formula.run_post_install
rescue Exception => e
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

trap("INT", old_trap)

formula = ARGV.formulae.first
formula = ARGV.resolved_formulae.first
formula.extend(Homebrew::Assertions)
formula.extend(Debrew::Formula) if ARGV.debug?

Expand Down

0 comments on commit 092d471

Please sign in to comment.