chiark / gitweb /
git-debrebase; Refactor resolve_upstream_version to take upstream version
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 3 Aug 2018 14:36:03 +0000 (15:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 3 Aug 2018 14:36:03 +0000 (15:36 +0100)
NFC.

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

index c111513..e75c90f 100755 (executable)
@@ -1185,9 +1185,7 @@ sub do_stitch ($;$) {
 }
 
 sub resolve_upstream_version ($$) {
-    my ($new_upstream, $version) = @_;
-
-    my $new_upstream_version = upstreamversion $version;
+    my ($new_upstream, $new_upstream_version) = @_;
 
     if (!defined $new_upstream) {
        my @tried;
@@ -1206,7 +1204,7 @@ sub resolve_upstream_version ($$) {
     }
     $new_upstream = git_rev_parse $new_upstream;
 
-    return ($new_upstream, $new_upstream_version);
+    return $new_upstream;
 }
 
 sub cmd_new_upstream () {
@@ -1226,9 +1224,9 @@ sub cmd_new_upstream () {
     }
 
     my $new_upstream = shift @ARGV;
-    my $new_upstream_version;
-    ($new_upstream, $new_upstream_version) =
-       resolve_upstream_version $new_upstream, $new_version;
+    my $new_upstream_version = upstreamversion  $new_version;
+    $new_upstream =
+       resolve_upstream_version $new_upstream, $new_upstream_version;
 
     record_ffq_auto();
 
@@ -1635,8 +1633,9 @@ sub cmd_convert_from_gbp () {
 
     my ($upstream_spec) = @ARGV;
 
-    my ($upstream, $upstream_version) =
-       resolve_upstream_version($upstream_spec, $version);
+    my $upstream_version = upstreamversion $version;
+    my $upstream =
+       resolve_upstream_version($upstream_spec, $upstream_version);
 
     my $old_head = get_head();