chiark / gitweb /
git-debrebase: walk: unprocessable: use fail, not die, and clean up
[dgit.git] / git-debrebase
index 7b2e4f311dfbdf64813d14cb2bac92184837a6ff..0c351a474459471abd8ec66b9a5a3c3ffac48bba 100755 (executable)
@@ -679,10 +679,11 @@ sub walk ($;$$) {
        if ($nogenerate) {
            return (undef,undef);
        }
-       die "commit $cur: Cannot cope with this commit (d.".
+       fail "found unprocessable commit, cannot cope:".
+           (defined $cl->{Why} ? "; $cl->{Why}": '').
+           " (commit $cur) (d.".
            (join ' ', map { sprintf "%#x", $_->{Differs} }
             @{ $cl->{Parents} }).
-           (defined $cl->{Why} ? "; $cl->{Why}": '').
                 ")";
     };
 
@@ -970,7 +971,8 @@ sub defaultcmd_rebase () {
 }
 
 sub cmd_analyse () {
-    die if ($ARGV[0]//'') =~ m/^-/;
+    badusage "analyse does not support any options"
+       if @ARGV and $ARGV[0] =~ m/^-/;
     badusage "too many arguments to analyse" if @ARGV>1;
     my ($old) = @ARGV;
     if (defined $old) {
@@ -1658,7 +1660,7 @@ sub cmd_convert_from_gbp () {
        print STDERR "cannot stitch in dgit view: $@\n";
     }
 
-    snags_maybe_bail();
+    snags_maybe_bail_early();
 
     my $work;
 
@@ -1696,6 +1698,8 @@ sub cmd_convert_from_gbp () {
        }
     };
 
+    ffq_check $work;
+    snags_maybe_bail();
     update_head_checkout $old_head, $work, 'convert-from-gbp';
 }