From c7cccea498425db98ad276d5b43ddb1148f88921 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 8 May 2020 02:11:41 +0200 Subject: 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 --- git-hooks/sanitize-commit | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'git-hooks') 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) { -- cgit v1.2.3