chiark / gitweb /
test suite: gdr-convert-gbp: Provide some unprocessable branches
[dgit.git] / git-debrebase
index 07e5f478cac58281570da99ef27e57953c0a6a53..3449ec3950ad98064baf6b0736455dfa76c456f9 100755 (executable)
@@ -573,7 +573,7 @@ sub keycommits ($;$$$$) {
     my ($anchor, $breakwater);
     my $clogonly;
     my $cl;
-    $fatal //= sub { fail $_[2]; };
+    $fatal //= sub { fail $_[1]; };
     my $x = sub {
        my ($cb, $tagsfx, $mainwhy, $xwhy) = @_;
        my $why = $mainwhy.$xwhy;
@@ -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}": '').
                 ")";
     };
 
@@ -1172,6 +1173,7 @@ sub cmd_new_upstream () {
     # parse args - low commitment
     my $spec_version = shift @ARGV;
     my $new_version = (new Dpkg::Version $spec_version, check => 1);
+    fail "bad version number \`$spec_version'" unless defined $new_version;
     if ($new_version->is_native()) {
        $new_version = (new Dpkg::Version "$spec_version-1", check => 1);
     }