From 8aec7aff3961d7521e9afb480bc5cb5632fa6547 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 24 Aug 2018 20:23:22 +0100 Subject: [PATCH] git-debrebase: classify: Do not misclassify patches in subdirs The old get_differs algorithm would recurse in debian/patches. The new one failed to do that. Fix that. Closes: #907206. Signed-off-by: Ian Jackson --- git-debrebase | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git-debrebase b/git-debrebase index 58d3a4ab..ddb47bf6 100755 --- a/git-debrebase +++ b/git-debrebase @@ -310,13 +310,16 @@ sub get_differs ($$) { my $xp = $ix && "$xd/patches"; my $yp = $iy && "$yd/patches"; - trees_diff_walk $xp, $yp, sub { + trees_diff_walk { recurse=>1 }, $xp, $yp, sub { my ($n,$ix,$iy) = @_; # analyse difference in debian/patches my $ok; - if ($n !~ m/\.series$/s && !$ix && $plain->($iy)) { + if ($n =~ m{/$}s) { + # we are recursing; directories may appear and disappear + $ok = 1; + } elsif ($n !~ m/\.series$/s && !$ix && $plain->($iy)) { $ok = 1; } elsif ($n eq 'series' && $plain->($ix) && $plain->($iy)) { my $x_s = (git_cat_file "$xp/series", 'blob'); -- 2.30.2