diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-08 19:40:35 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-09 00:15:21 +0100 |
commit | e61a5d637119adfbdb1b38f3a23e36cb7da6a7ac (patch) | |
tree | d136fe929d8fcdd83b697a0078f28f42993dd75c | |
parent | 19309e667c41eb0a3149d1bdf7a1a20dc20dda2a (diff) |
git-debrebase: ffq_check: Move defaults for $ff and $notff into sub
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | git-debrebase | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/git-debrebase b/git-debrebase index b029e5c..a79b486 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(); |