chiark / gitweb /
git-debrebase: Have resolve_upstream_commit set @$tried first
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Aug 2018 06:52:38 +0000 (07:52 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Aug 2018 06:52:38 +0000 (07:52 +0100)
This allows a caller to know what tag name was successfully found,
by looking at $tried[-1];

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 35284d5..13c320e 100755 (executable)
@@ -1190,8 +1190,8 @@ sub upstream_commitish_search ($$) {
     foreach my $tagpfx ('', 'v', 'upstream/') {
        my $tag = $tagpfx.(dep14_version_mangle $upstream_version);
        my $new_upstream = git_get_ref "refs/tags/$tag";
-       return $new_upstream if length $new_upstream;
        push @$tried, $tag;
+       return $new_upstream if length $new_upstream;
     }
 }