@@ -213,4 +213,70 @@ test_expect_success 'blame: --no-indent-heuristic overrides config' '
213213 compare_blame spaces-expect out-blame2
214214'
215215
216+ test_expect_success ' diff-tree: nice spaces with --indent-heuristic' '
217+ git diff-tree --indent-heuristic -p old new -- spaces.txt >out-diff-tree-compacted &&
218+ compare_diff spaces-compacted-expect out-diff-tree-compacted
219+ '
220+
221+ test_expect_success ' diff-tree: nice spaces with diff.indentHeuristic' '
222+ git -c diff.indentHeuristic=true diff-tree -p old new -- spaces.txt >out-diff-tree-compacted2 &&
223+ compare_diff spaces-compacted-expect out-diff-tree-compacted2
224+ '
225+
226+ test_expect_success ' diff-tree: --no-indent-heuristic overrides config' '
227+ git -c diff.indentHeuristic=true diff-tree --no-indent-heuristic -p old new -- spaces.txt >out-diff-tree &&
228+ compare_diff spaces-expect out-diff-tree
229+ '
230+
231+ test_expect_success ' diff-index: nice spaces with --indent-heuristic' '
232+ git checkout -B diff-index &&
233+ git reset --soft HEAD~ &&
234+ git diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted &&
235+ compare_diff spaces-compacted-expect out-diff-index-compacted &&
236+ git checkout -f master
237+ '
238+
239+ test_expect_success ' diff-index: nice spaces with diff.indentHeuristic' '
240+ git checkout -B diff-index &&
241+ git reset --soft HEAD~ &&
242+ git -c diff.indentHeuristic=true diff-index -p old -- spaces.txt >out-diff-index-compacted2 &&
243+ compare_diff spaces-compacted-expect out-diff-index-compacted2 &&
244+ git checkout -f master
245+ '
246+
247+ test_expect_success ' diff-index: --no-indent-heuristic overrides config' '
248+ git checkout -B diff-index &&
249+ git reset --soft HEAD~ &&
250+ git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
251+ compare_diff spaces-expect out-diff-index &&
252+ git checkout -f master
253+ '
254+
255+ test_expect_success ' diff-files: nice spaces with diff.indentHeuristic' '
256+ git checkout -B diff-files &&
257+ git reset HEAD~ &&
258+ git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw &&
259+ grep -v index out-diff-files-raw >out-diff-files-compacted &&
260+ compare_diff spaces-compacted-expect out-diff-files-compacted &&
261+ git checkout -f master
262+ '
263+
264+ test_expect_success ' diff-files: nice spaces with diff.indentHeuristic' '
265+ git checkout -B diff-files &&
266+ git reset HEAD~ &&
267+ git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw2 &&
268+ grep -v index out-diff-files-raw2 >out-diff-files-compacted2 &&
269+ compare_diff spaces-compacted-expect out-diff-files-compacted2 &&
270+ git checkout -f master
271+ '
272+
273+ test_expect_success ' diff-files: --no-indent-heuristic overrides config' '
274+ git checkout -B diff-files &&
275+ git reset HEAD~ &&
276+ git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
277+ grep -v index out-diff-files-raw3 >out-diff-files &&
278+ compare_diff spaces-expect out-diff-files &&
279+ git checkout -f master
280+ '
281+
216282test_done
0 commit comments