diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-08-11 12:22:54 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-08-11 12:22:54 +0100 |
commit | 2250673c9e458438ae3df6c98bbf0423e81891d3 (patch) | |
tree | a33db37367f3de119b2181d718af199f4e629655 | |
parent | b62c158368158b278bcb31447f8b1442cb531898 (diff) |
git-debrebase: keycommits: Break out $found_anchor
We are going to want to reuse this.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | git-debrebase | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/git-debrebase b/git-debrebase index 3d8d6f3..06cdc76 100755 --- a/git-debrebase +++ b/git-debrebase @@ -846,6 +846,13 @@ sub keycommits ($;$$$$) { return unless $cb; $cb->("unclean-$tagsfx", $why, $cl, $mainwhy); }; + my $found_anchor = sub { + ($anchor) = @_; + $breakwater //= $clogonly; + $breakwater //= $head; + no warnings qw(exiting); + last; + }; for (;;) { $cl = classify $head; my $ty = $cl->{Type}; @@ -859,10 +866,7 @@ sub keycommits ($;$$$$) { } elsif ($ty eq 'Anchor' or $ty eq 'TreatAsAnchor' or $ty eq 'BreakwaterStart') { - $anchor = $head; - $breakwater //= $clogonly; - $breakwater //= $head; - last; + $found_anchor->($head); } elsif ($ty eq 'Upstream') { $x->($unclean, 'ordering', "packaging change ($breakwater) follows upstream change"," (eg $head)") |