diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2019-06-28 17:29:02 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2019-06-29 00:43:18 +0100 |
commit | 359f4592c6035ee027cf283c6af7dcd435038776 (patch) | |
tree | cb524982b45bfa45f2742b40ddff0b71632a3426 /Debian | |
parent | 6a45cf9105d9db0c73ba474e043790e886b61f20 (diff) |
Dgit.pm: Move upstream_commitish_search from git-debrebase
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'Debian')
-rw-r--r-- | Debian/Dgit.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 455cb10..892ebf9 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -45,7 +45,7 @@ BEGIN { dep14_version_mangle debiantags debiantag_new debiantag_maintview - upstreamversion + upstreamversion upstream_commitish_search stripepoch source_file_leafname is_orig_file_of_p_v server_branch server_ref stat_exists link_ltarget rename_link_xf @@ -617,6 +617,17 @@ sub git_check_unmodified () { } } +sub upstream_commitish_search ($$) { + my ($upstream_version, $tried) = @_; + # todo: at some point maybe use git-deborig to do this + 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; + } +} + sub is_fast_fwd ($$) { my ($ancestor,$child) = @_; my @cmd = (qw(git merge-base), $ancestor, $child); |