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 2137280..c3bd7ff 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 ($$$) {