summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-debrebase19
1 files changed, 12 insertions, 7 deletions
diff --git a/git-debrebase b/git-debrebase
index a28b910..35284d5 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -1184,18 +1184,23 @@ sub do_stitch ($;$) {
stitch($dangling_head, $ffq_prev, $gdrlast, $ffq_prev_commitish, $prose);
}
+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";
+ return $new_upstream if length $new_upstream;
+ push @$tried, $tag;
+ }
+}
+
sub resolve_upstream_version ($$) {
my ($new_upstream, $upstream_version) = @_;
if (!defined $new_upstream) {
my @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);
- $new_upstream = git_get_ref "refs/tags/$tag";
- last if length $new_upstream;
- push @tried, $tag;
- }
+ $new_upstream = upstream_commitish_search $upstream_version, \@tried;
if (!length $new_upstream) {
fail "Could not determine appropriate upstream commitish.\n".
" (Tried these tags: @tried)\n".