Skip to content
Snippets Groups Projects
Commit 63c563f9 authored by Uladzislau Shablinski's avatar Uladzislau Shablinski Committed by Xu Cheng
Browse files

Fix update commit for non-HEAD kegs with head spec (#644)

If we try to call `Formulary.from_keg(f, :head)` on the keg that
is not HEAD-keg itself, we don't need to update commit of
returned formula and should use just HEAD version with nil commit.

Same is true for `ARGV.resolved_formulae`
parent 8ec59253
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ module HomebrewArgvExtension
f.build = tab
if f.head? && tab.tabfile
k = Keg.new(tab.tabfile.parent)
f.version.update_commit(k.version.version.commit)
f.version.update_commit(k.version.version.commit) if k.version.head?
end
end
f
......
......@@ -246,7 +246,7 @@ class Formulary
end
end
f.build = tab
f.version.update_commit(keg.version.version.commit) if f.head?
f.version.update_commit(keg.version.version.commit) if f.head? && keg.version.head?
f
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment