chiark / gitweb /
git-debrebase: fix rm of debian/patches not to mind if there aren't any
[dgit.git] / git-debrebase
index f73bf0c1d8489e7a1535231a3eb6eab5de93d4ed..ed3fc55e3a643e73a23f224f741a9417a7a05fb6 100755 (executable)
@@ -665,7 +665,7 @@ sub walk ($;$$) {
            $ch =~ s{^tree .*}{tree $newtree}m or confess "$ch ?";
            $ch =~ s{^parent .*\n}{}m;
            $ch =~ s{(?=^author)}{
-               map { "parent $_\n" } @parents
+               join '', map { "parent $_\n" } @parents
            }me or confess "$ch ?";
            if ($rewriting) {
                $ch =~ s{^committer .*$}{$committer_authline}m
@@ -684,7 +684,9 @@ sub walk ($;$$) {
        }
     };
 
-    runcmd @git, qw(diff-tree --quiet), $input, $build;
+    my $final_check = get_differs $build, $input;
+    die sprintf "internal error %#x", $final_check
+       if $final_check & ~D_PAT_ADD;
 
     return ($build, $breakwater);
 }
@@ -709,7 +711,7 @@ sub cmd_launder () {
     my ($tip,$breakwater) = walk $old;
     update_head $old, $tip, 'launder';
     # no tree changes except debian/patches
-    runcmd @git, qw(rm --quiet -rf debian/patches);
+    runcmd @git, qw(rm --quiet --ignore-unmatch -rf debian/patches);
     printf "# breakwater tip\n%s\n", $breakwater;
 }