Code

Merge branch 'th/mergetools-deltawalker'
[git.git] / t / t2013-checkout-submodule.sh
index fda3f0af7eb0fcaf7d0d61ff10a22e2dedaa416b..70edbb33e26c0ee6d5cec81d2417c8a830d6fab1 100755 (executable)
@@ -39,4 +39,27 @@ test_expect_success '"checkout <submodule>" updates the index only' '
        git diff-files --quiet
 '
 
+test_expect_success '"checkout <submodule>" honors diff.ignoreSubmodules' '
+       git config diff.ignoreSubmodules dirty &&
+       echo x> submodule/untracked &&
+       git checkout HEAD >actual 2>&1 &&
+       ! test -s actual
+'
+
+test_expect_success '"checkout <submodule>" honors submodule.*.ignore from .gitmodules' '
+       git config diff.ignoreSubmodules none &&
+       git config -f .gitmodules submodule.submodule.path submodule &&
+       git config -f .gitmodules submodule.submodule.ignore untracked &&
+       git checkout HEAD >actual 2>&1 &&
+       ! test -s actual
+'
+
+test_expect_success '"checkout <submodule>" honors submodule.*.ignore from .git/config' '
+       git config -f .gitmodules submodule.submodule.ignore none &&
+       git config submodule.submodule.path submodule &&
+       git config submodule.submodule.ignore all &&
+       git checkout HEAD >actual 2>&1 &&
+       ! test -s actual
+'
+
 test_done