Merge branch 'tq/git-ssh-command'
[gitweb.git] / t / t4124-apply-ws-rule.sh
index 581a801649f20a74e81c32f9503f233c3cd3d507..c6474de4c8c30eba9b5375f6c4e176e67c1fd001 100755 (executable)
@@ -486,4 +486,41 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol unset' '
        test_cmp one expect
 '
 
+test_expect_success 'whitespace=fix to expand' '
+       qz_to_tab_space >preimage <<-\EOF &&
+       QQa
+       QQb
+       QQc
+       ZZZZZZZZZZZZZZZZd
+       QQe
+       QQf
+       QQg
+       EOF
+       qz_to_tab_space >patch <<-\EOF &&
+       diff --git a/preimage b/preimage
+       --- a/preimage
+       +++ b/preimage
+       @@ -1,7 +1,6 @@
+        QQa
+        QQb
+        QQc
+       -QQd
+        QQe
+        QQf
+        QQg
+       EOF
+       git -c core.whitespace=tab-in-indent apply --whitespace=fix patch
+'
+
+test_expect_success 'whitespace check skipped for excluded paths' '
+       git config core.whitespace blank-at-eol &&
+       >used &&
+       >unused &&
+       git add used unused &&
+       echo "used" >used &&
+       echo "unused " >unused &&
+       git diff-files -p used unused >patch &&
+       git apply --include=used --stat --whitespace=error <patch
+'
+
 test_done