From: Ian Jackson Date: Sat, 4 Jun 2016 15:57:35 +0000 (+0100) Subject: Split brain: Provide optional $ignorenamesr argument to quiltify_trees_differ X-Git-Tag: archive/debian/2.0~307 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=7f4b27dad75955090b3777216c31c9d0ab073f49 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. --- 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;