diff options
author | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2020-05-08 02:11:41 +0200 |
---|---|---|
committer | Daniel Smith <Daniel.Smith@qt.io> | 2020-05-15 07:39:50 +0000 |
commit | c7cccea498425db98ad276d5b43ddb1148f88921 (patch) | |
tree | ca706c0b068d3389c496f0fb38531aa3a85b57c5 /git-hooks | |
parent | d70bdf7bbca5e3426a49381af049e9f2632a4bf6 (diff) |
take advantage of now having a proper ref->sha1 mapping
this makes things marginally faster, but mostly just more consistent.
Change-Id: Ifdd84b54bb541ba13c9ff1fa349e0a2479f6060f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'git-hooks')
-rwxr-xr-x | git-hooks/sanitize-commit | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit index 98f4e27..e5fada1 100755 --- a/git-hooks/sanitize-commit +++ b/git-hooks/sanitize-commit @@ -347,15 +347,14 @@ if (!$with_pickbot && $foundDev && $foundLts) { if (defined($target)) { $ltsForSha1 = $1 if ($target =~ /^(\d+\.\d+)/ && any { $1 eq $_ } @LTS); } else { - my $refPfx = ($seenOrigin ? "refs/remotes/origin" : "refs/heads"); - chomp(my $sha1Base = `git merge-base $sha1 $refPfx/dev`); + chomp(my $sha1Base = `git merge-base $sha1 $allHeads{dev}`); foreach my $lts (@LTS) { next if (!defined($nonDevHeads{$lts})); my $key = "cached-lts-$lts-fork"; $key =~ s/\./-/g; # so the dot in $lts isn't a section name boundary in the key my $diverge = $config{$key}; if (!$diverge) { - chomp($diverge = `git merge-base $refPfx/dev $refPfx/$lts`); + chomp($diverge = `git merge-base $allHeads{$lts} $allHeads{dev}`); system("git config sanity.$instance.$key $diverge"); } if ($sha1Base eq $diverge) { |