diff options
Diffstat (limited to 'git-debrebase')
-rwxr-xr-x | git-debrebase | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/git-debrebase b/git-debrebase index 9a356df..c180a29 100755 --- a/git-debrebase +++ b/git-debrebase @@ -538,8 +538,8 @@ sub classify ($) { return $unknown->("complex merge"); } -sub keycommits ($;$$$) { - my ($head, $furniture, $unclean, $trouble) = @_; +sub keycommits ($;$$$$) { + my ($head, $furniture, $unclean, $trouble, $fatal) = @_; # => ($anchor, $breakwater) # $unclean->("unclean-$tagsfx", $msg, $cl) @@ -552,6 +552,8 @@ sub keycommits ($;$$$) { # $trouble is for things whnich prevent the return of # anchor and breakwater information; if that is ignored, # then keycommits returns (undef, undef) instead. + # $fatal is for unprocessable commits, and should normally cause + # a failure. If ignored, agaion, (undef, undef) is returned. # # If a callback is undef, fail is called instead. # If a callback is defined but false, the situation is ignored. @@ -562,6 +564,7 @@ sub keycommits ($;$$$) { my ($anchor, $breakwater); my $clogonly; my $cl; + $fatal //= sub { fail $_[2]; }; my $x = sub { my ($cb, $tagsfx, $why) = @_; my $m = "branch needs laundering (run git-debrebase): $why"; @@ -606,7 +609,10 @@ sub keycommits ($;$$$) { "found dgit dsc import ($head)"); return (undef,undef); } else { - fail "found unprocessable commit, cannot cope: $head; $cl->{Why}"; + $x->($fatal, 'unprocessable', + "found unprocessable commit, cannot cope: $head; $cl->{Why}" + ); + return (undef,undef); } $head = $cl->{Parents}[0]{CommitId}; } |