Skip to content

Commit 62ed009

Browse files
jlehmanngitster
authored andcommitted
checkout: Add test for diff.ignoreSubmodules
While at it, document that checkout uses this flag too in the Documentation. Signed-off-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 175f6e5 commit 62ed009

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Documentation/config.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,8 @@ diff.renames::
829829
diff.ignoreSubmodules::
830830
Sets the default value of --ignore-submodules. Note that this
831831
affects only 'git diff' Porcelain, and not lower level 'diff'
832-
commands such as 'git diff-files'.
832+
commands such as 'git diff-files'. 'git checkout' also honors
833+
this setting when reporting uncommitted changes.
833834

834835
diff.suppressBlankEmpty::
835836
A boolean to inhibit the standard behavior of printing a space

t/t2013-checkout-submodule.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,11 @@ test_expect_success '"checkout <submodule>" updates the index only' '
3939
git diff-files --quiet
4040
'
4141

42+
test_expect_success '"checkout <submodule>" honors diff.ignoreSubmodules' '
43+
git config diff.ignoreSubmodules dirty &&
44+
echo x> submodule/untracked &&
45+
git checkout HEAD >actual 2>&1 &&
46+
! test -s actual
47+
'
48+
4249
test_done

0 commit comments

Comments
 (0)