chiark / gitweb /
git-debrebase: merge: Introduce merge_attempt_cmd global
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 19:14:58 +0000 (20:14 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 19:14:58 +0000 (20:14 +0100)
NFC

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

index 25ebbe6..f332cfd 100755 (executable)
@@ -417,6 +417,17 @@ sub mwrecknote ($$$) {
     $wrecknotes->{$reftail} = $commitish;
 }
 
+sub merge_attempt_cmd {
+    my $wrecknotes = shift @_;
+    debugcmd '+', @_;
+    $!=0; $?=-1;
+    if (system @_) {
+       merge_failed $wrecknotes,
+           failedcmd_waitstatus(),
+           "failed command: @_";
+    }
+}
+
 sub merge_series ($$$;@) {
     my ($newbase, $wrecknotes, $base_q, @input_qs) = @_;
     # $base_q{SeriesBase}  $input_qs[]{SeriesBase}
@@ -445,15 +456,7 @@ sub merge_series ($$$;@) {
 
     my $mwrecknote = sub { &mwrecknote($wrecknotes, @_); };
 
-    my $attempt_cmd = sub {
-       debugcmd '+', @_;
-       $!=0; $?=-1;
-       if (system @_) {
-           merge_failed $wrecknotes,
-               failedcmd_waitstatus(),
-               "failed command: @_";
-       }
-    };
+    my $attempt_cmd = sub { &merge_attempt_cmd($wrecknotes, @_); };
 
     local $workarea;
     fresh_workarea "merge";