From e61a5d637119adfbdb1b38f3a23e36cb7da6a7ac Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 Jul 2018 19:40:35 +0100 Subject: [PATCH] git-debrebase: ffq_check: Move defaults for $ff and $notff into sub No functional change. Signed-off-by: Ian Jackson --- git-debrebase | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/git-debrebase b/git-debrebase index b029e5cf..a79b4867 100755 --- a/git-debrebase +++ b/git-debrebase @@ -980,7 +980,7 @@ sub ffq_prev_branchinfo () { return gdr_ffq_prev_branchinfo($current); } -sub ffq_check ($$$) { +sub ffq_check ($;$$) { # calls $ff and/or $notff zero or more times # then returns either (status,message) where status is # exists @@ -994,6 +994,9 @@ sub ffq_check ($$$) { # normally $currentval should be HEAD my ($currentval, $ff, $notff) =@_; + $ff //= sub { print $_[0] or die $!; }; + $notff //= \&snag; + my ($status, $message, $current, $ffq_prev, $gdrlast) = ffq_prev_branchinfo(); return ($status, $message) unless $status eq 'branch'; @@ -1073,8 +1076,7 @@ sub record_ffq_prev_deferred () { # some messages about ff checks my $currentval = get_head(); - my ($status,$message, $ffq_prev,$gdrlast) = - ffq_check $currentval, sub { print $_[0] or die $!; }, \&snag; + my ($status,$message, $ffq_prev,$gdrlast) = ffq_check $currentval; return ($status,$message) if defined $status; snags_maybe_bail(); -- 2.30.2