chiark / gitweb /
git-debrebase: classify: Do not misclassify patches in subdirs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 24 Aug 2018 19:23:22 +0000 (20:23 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 24 Aug 2018 19:26:21 +0000 (20:26 +0100)
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 <ijackson@chiark.greenend.org.uk>
git-debrebase

index 58d3a4abf3e3bf4a0acd2a2c5d2fcfaab1b6fdfd..ddb47bf6f29645665240cb459891239dcc7b5340 100755 (executable)
@@ -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');