From 7f4b27dad75955090b3777216c31c9d0ab073f49 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 4 Jun 2016 16:57:35 +0100 Subject: [PATCH] Split brain: Provide optional $ignorenamesr argument to quiltify_trees_differ We are going to need this information to construct the substantive diff for the .gitignores patch. --- dgit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dgit b/dgit index 4f12594f..1c52b635 100755 --- a/dgit +++ b/dgit @@ -2515,8 +2515,8 @@ END } } -sub quiltify_trees_differ ($$;$) { - my ($x,$y,$finegrained) = @_; +sub quiltify_trees_differ ($$;$$) { + my ($x,$y,$finegrained,$ignorenamesr) = @_; # returns true iff the two tree objects differ other than in debian/ # with $finegrained, # returns bitmask 01 - differ in upstream files except .gitignore @@ -2531,7 +2531,9 @@ sub quiltify_trees_differ ($$;$) { my $r = 0; foreach my $f (split /\0/, $diffs) { next if $f =~ m#^debian(?:/.*)?$#s; - $r |= ($f =~ m#^(?:.*/)?.gitignore$#s) ? 02 : 01; + my $isignore = $f =~ m#^(?:.*/)?.gitignore$#s; + $r |= $isignore ? 02 : 01; + $ignorenamesr->{$f}=1 if $ignorenamesr && $isignore; } printdebug "quiltify_trees_differ $x $y => $r\n"; return $r; -- 2.30.2