From 0bb8e2a87e3c8b5be0fce5c2491b292e9273056e Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 27 May 2020 13:49:07 -0700 Subject: Dgit::upstream_commitish_search: fail if more than one tag exists We should not assume we know which the user wants to merge, as git-deborig does not. Signed-off-by: Sean Whitton Reported-by: David Bremner Reviewed-by: Ian Jackson --- Debian/Dgit.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Debian') diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 5d898ae..4e19657 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -634,12 +634,14 @@ sub git_check_unmodified () { sub upstream_commitish_search ($$) { my ($upstream_version, $tried) = @_; # todo: at some point maybe use git-deborig to do this + my @found; foreach my $tagpfx ('', 'v', 'upstream/') { my $tag = $tagpfx.(dep14_version_mangle $upstream_version); my $new_upstream = git_get_ref "refs/tags/$tag"; push @$tried, $tag; - return $new_upstream if length $new_upstream; + push @found, $tag if $new_upstream; } + return $found[0] if @found == 1; } sub resolve_upstream_version ($$) { -- cgit v1.2.3