From: Ian Jackson Date: Fri, 24 Aug 2018 19:23:22 +0000 (+0100) Subject: git-debrebase: classify: Do not misclassify patches in subdirs X-Git-Tag: archive/debian/6.10~69 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8aec7aff3961d7521e9afb480bc5cb5632fa6547;hp=fc0f0a517d86fc5e4b1d9089c9960778435651cf;p=dgit.git 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 --- 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');