Skip to content

Commit 46e3d17

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e5f7675 commit 46e3d17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git-add--interactive.perl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
my $normal_color = $repo->get_color("", "reset");
4646

4747
my $diff_algorithm = $repo->config('diff.algorithm');
48+
my $diff_compaction_heuristic = $repo->config_bool('diff.compactionheuristic');
4849
my $diff_filter = $repo->config('interactive.difffilter');
4950

5051
my $use_readkey = 0;
@@ -749,6 +750,9 @@ sub parse_diff {
749750
if (defined $diff_algorithm) {
750751
splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}";
751752
}
753+
if ($diff_compaction_heuristic) {
754+
splice @diff_cmd, 1, 0, "--compaction-heuristic";
755+
}
752756
if (defined $patch_mode_revision) {
753757
push @diff_cmd, get_diff_reference($patch_mode_revision);
754758
}

0 commit comments

Comments
 (0)