chiark / gitweb /
git-debrebase: merge: Defeat evals which might try to trap merge_failed
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 17:55:04 +0000 (18:55 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 19:11:09 +0000 (20:11 +0100)
That would be dangerous because we're in the wrong directory and other
things may be wrong.  For example, if we continue we might overwrite
wreckage with other wreckage.

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

index 213728023f249305eb873722d305f3168a1cb0c4..c3bd7ff2cd287dd3054cf3e277017e8666cbfc2e 100755 (executable)
@@ -396,8 +396,12 @@ sub merge_failed ($$) {
     push @m, "Wreckage left in $wrecknoteprefix/*.";
 
     push @m, "See git-debrebase(1) section FAILED MERGES for suggestions.";
-    # ^ xxx this section does not yet exist
-    fail join '', map { "$_\n" } @m;
+
+    # use finish rather than fail, in case we are within an eval
+    # (that can happen inside walk!)
+    print STDERR "\n";
+    print STDERR "$us: $_\n" foreach @m;
+    finish 15;
 }
 
 sub mwrecknote ($$$) {