From 849364df60ca1dfedfbd23597fdab6a98881cb19 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 19 Aug 2018 23:58:49 +0100 Subject: git-debrebase: Introduce new `fail_unprocessable' This is called when we want to call `fail' because we have found an unprocessable commit. NFC. Signed-off-by: Ian Jackson --- git-debrebase | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git-debrebase b/git-debrebase index 9d0bda0..484fcdc 100755 --- a/git-debrebase +++ b/git-debrebase @@ -439,6 +439,11 @@ sub record_gdrlast ($$;$) { push @deferred_updates, "update $gdrlast $newvalue $oldvalue"; } +sub fail_unprocessable ($) { + my ($msg) = @_; + fail $msg; +}; + sub gbp_pq_export ($$$) { my ($bname, $base, $tip) = @_; # must be run in a workarea. $bname and patch-queue/$bname @@ -1054,7 +1059,7 @@ sub keycommits ($;$$$$$) { my $clogonly; my $cl; my $found_pm; - $fatal //= sub { fail $_[1]; }; + $fatal //= sub { fail_unprocessable $_[1]; }; my $x = sub { my ($cb, $tagsfx, $mainwhy, $xwhy) = @_; my $why = $mainwhy.$xwhy; @@ -1179,7 +1184,7 @@ sub walk ($;$$$) { if ($nogenerate) { return (undef,undef); } - fail "found unprocessable commit, cannot cope". + fail_unprocessable "found unprocessable commit, cannot cope". (defined $cl->{Why} ? "; $cl->{Why}:": ':'). " (commit $cur) (d.". (join ' ', map { sprintf "%#x", $_->{Differs} } -- cgit v1.2.3