1460
EOF
1461
test_cmp expected actual &&
1462
1463
- git diff HEAD --no-renames -w --color-moved --color >actual.raw &&
1463
+ git diff HEAD --no-renames --color-moved --color \
1464
+ --color-moved-ws=ignore-all-space >actual.raw &&
1465
grep -v "index" actual.raw | test_decode_color >actual &&
1466
cat <<-\EOF >expected &&
1467
<BOLD>diff --git a/lines.txt b/lines.txt<RESET>
1523
EOF
1524
test_cmp expected actual &&
1525
1525
- git diff HEAD --no-renames -b --color-moved --color >actual.raw &&
1526
+ git diff HEAD --no-renames --color-moved --color \
1527
+ --color-moved-ws=ignore-space-change >actual.raw &&
1528
grep -v "index" actual.raw | test_decode_color >actual &&
1529
cat <<-\EOF >expected &&
1530
<BOLD>diff --git a/lines.txt b/lines.txt<RESET>
1589
EOF
1590
test_cmp expected actual &&
1591
1590
- git diff HEAD --no-renames --ignore-space-at-eol --color-moved --color >actual.raw &&
1592
+ git diff HEAD --no-renames --color-moved --color \
1593
+ --color-moved-ws=ignore-space-at-eol >actual.raw &&
1594
grep -v "index" actual.raw | test_decode_color >actual &&
1595
cat <<-\EOF >expected &&
1596
<BOLD>diff --git a/lines.txt b/lines.txt<RESET>
1760
1761
# nor did we mess with it another way
1762
git diff --submodule=diff --color | test_decode_color >expect &&
1760
- test_cmp expect decoded_actual
1763
+ test_cmp expect decoded_actual &&
1764
+ rm -rf bananas &&
1765
+ git submodule deinit bananas
1766
+'
1767
+
1768
+test_expect_success 'only move detection ignores white spaces' '
1769
+ git reset --hard &&
1770
+ q_to_tab <<-\EOF >text.txt &&
1771
+ a long line to exceed per-line minimum
1772
+ another long line to exceed per-line minimum
1773
+ original file
1774
+ EOF
1775
+ git add text.txt &&
1776
+ git commit -m "add text" &&
1777
+ q_to_tab <<-\EOF >text.txt &&
1778
+ Qa long line to exceed per-line minimum
1779
+ Qanother long line to exceed per-line minimum
1780
+ new file
1781
+ EOF
1782
+
1783
+ # Make sure we get a different diff using -w
1784
+ git diff --color --color-moved -w >actual.raw &&
1785
+ grep -v "index" actual.raw | test_decode_color >actual &&
1786
+ q_to_tab <<-\EOF >expected &&
1787
+ <BOLD>diff --git a/text.txt b/text.txt<RESET>
1788
+ <BOLD>--- a/text.txt<RESET>
1789
+ <BOLD>+++ b/text.txt<RESET>
1790
+ <CYAN>@@ -1,3 +1,3 @@<RESET>
1791
+ Qa long line to exceed per-line minimum<RESET>
1792
+ Qanother long line to exceed per-line minimum<RESET>
1793
+ <RED>-original file<RESET>
1794
+ <GREEN>+<RESET><GREEN>new file<RESET>
1795
+ EOF
1796
+ test_cmp expected actual &&
1797
+
1798
+ # And now ignoring white space only in the move detection
1799
+ git diff --color --color-moved \
1800
+ --color-moved-ws=ignore-all-space,ignore-space-change,ignore-space-at-eol >actual.raw &&
1801
+ grep -v "index" actual.raw | test_decode_color >actual &&
1802
+ q_to_tab <<-\EOF >expected &&
1803
+ <BOLD>diff --git a/text.txt b/text.txt<RESET>
1804
+ <BOLD>--- a/text.txt<RESET>
1805
+ <BOLD>+++ b/text.txt<RESET>
1806
+ <CYAN>@@ -1,3 +1,3 @@<RESET>
1807
+ <BOLD;MAGENTA>-a long line to exceed per-line minimum<RESET>
1808
+ <BOLD;MAGENTA>-another long line to exceed per-line minimum<RESET>
1809
+ <RED>-original file<RESET>
1810
+ <BOLD;YELLOW>+<RESET>Q<BOLD;YELLOW>a long line to exceed per-line minimum<RESET>
1811
+ <BOLD;YELLOW>+<RESET>Q<BOLD;YELLOW>another long line to exceed per-line minimum<RESET>
1812
+ <GREEN>+<RESET><GREEN>new file<RESET>
1813
+ EOF
1814
+ test_cmp expected actual
1815
'
1816
1817
test_done