add--interactive: respect diff.compactionHeuristic

We use plumbing to generate the diff, so it doesn't automatically pick up UI config like compactionHeuristic. Let's forward it on, since interactive adding is porcelain. Note that we only need to handle the "true" case. There's no point in passing --no-compaction-heuristic when the variable is false, since nothing else could have turned it on. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jun 16, 2016 at 08:27 UTC 46e3d17f57f90538242b7a1dde126eba59f7c5ab
1 file changed +4
git-add--interactive.perl
+4
@@ -45,6 +45,7 @@ my ($diff_new_color) =
45 my $normal_color = $repo->get_color("", "reset");
46
47 my $diff_algorithm = $repo->config('diff.algorithm');
48 +my $diff_compaction_heuristic = $repo->config_bool('diff.compactionheuristic');
49 my $diff_filter = $repo->config('interactive.difffilter');
50
51 my $use_readkey = 0;
@@ -749,6 +750,9 @@ sub parse_diff {
750 if (defined $diff_algorithm) {
751 splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}";
752 }
753 + if ($diff_compaction_heuristic) {
754 + splice @diff_cmd, 1, 0, "--compaction-heuristic";
755 + }
756 if (defined $patch_mode_revision) {
757 push @diff_cmd, get_diff_reference($patch_mode_revision);
758 }