X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=git-debrebase;h=06cdc7692ccdeeeb367b6ec244afc742ff004840;hp=3d8d6f33a5669c425721a55c3d1da2943308874f;hb=2250673c9e458438ae3df6c98bbf0423e81891d3;hpb=99068bbe18c8fe83714639cc4ba9adcab5d71e59 diff --git a/git-debrebase b/git-debrebase index 3d8d6f33..06cdc769 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)")