chiark / gitweb /
dgit: import_dsc: Break out import_dsc_result
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 15 Jan 2017 18:36:47 +0000 (18:36 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 16 Jan 2017 01:13:26 +0000 (01:13 +0000)
No functional change other than slight change to messages.

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

diff --git a/dgit b/dgit
index fbf844e08370225f191f4bdc3a63ce602c80d703..dbfe1ac3278061116197233f630730564eefd121 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6049,6 +6049,13 @@ sub cmd_quilt_fixup {
     build_maybe_quilt_fixup();
 }
 
+sub import_dsc_result {
+    my ($dstref, $newhash, $what_log, $what_msg) = @_;
+    my @cmd = (@git, qw(update-ref -m), $what_log, $dstref, $newhash);
+    runcmd @cmd;
+    progress "dgit: import-dsc: $what_msg";
+}
+
 sub cmd_import_dsc {
     my $needsig = 0;
 
@@ -6145,10 +6152,9 @@ END
                fail "Not fast forward to $dsc_hash";
            }
        }
-       @cmd = (@git, qw(update-ref -m), "dgit import-dsc (Dgit): $info",
-               $dstbranch, $dsc_hash);
-       runcmd @cmd;
-       progress "dgit: import-dsc updated git ref $dstbranch";
+       import_dsc_result $dstbranch, $dsc_hash,
+           "dgit import-dsc (Dgit): $info",
+           "updated git ref $dstbranch";
        return 0;
     }
 
@@ -6208,10 +6214,9 @@ END
        }
     }
 
-    my @cmd = (@git, qw(update-ref -m), "dgit import-dsc: $info",
-              $dstbranch, $newhash);
-    runcmd @cmd;
-    progress "dgit: import-dsc results are in in git ref $dstbranch";
+    import_dsc_result $dstbranch, $newhash,
+       "dgit import-dsc: $info",
+       "results are in in git ref $dstbranch";
 }
 
 sub cmd_archive_api_query {