3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description
='git status'
9 *MINGW
*) GIT_TEST_CMP
="diff -uw";;
14 test_expect_success
'status -h in broken repository' '
16 test_when_finished "rm -fr broken" &&
20 echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
21 test_expect_code 129 git status -h >usage 2>&1
23 test_i18ngrep "[Uu]sage" broken/usage
26 test_expect_success
'commit -h in broken repository' '
28 test_when_finished "rm -fr broken" &&
32 echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
33 test_expect_code 129 git commit -h >usage 2>&1
35 test_i18ngrep "[Uu]sage" broken/usage
38 test_expect_success
'setup' '
52 git commit -m initial &&
56 echo 1 >dir1/modified &&
57 echo 2 >dir2/modified &&
62 test_expect_success
'status (1)' '
63 test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output
66 test_expect_success
'status --column' '
67 COLUMNS=50 git status --column="column dense" >output &&
70 # Changes to be committed:
71 # (use "git reset HEAD <file>..." to unstage)
73 # new file: dir2/added
75 # Changes not staged for commit:
76 # (use "git add <file>..." to update what will be committed)
77 # (use "git checkout -- <file>..." to discard changes in working directory)
79 # modified: dir1/modified
82 # (use "git add <file>..." to include in what will be committed)
84 # dir1/untracked dir2/untracked untracked
85 # dir2/modified output
87 test_cmp expect output
92 # Changes to be committed:
93 # (use "git reset HEAD <file>..." to unstage)
95 # new file: dir2/added
97 # Changes not staged for commit:
98 # (use "git add <file>..." to update what will be committed)
99 # (use "git checkout -- <file>..." to discard changes in working directory)
101 # modified: dir1/modified
104 # (use "git add <file>..." to include in what will be committed)
114 test_expect_success
'status (2)' '
115 git status >output &&
116 test_i18ncmp expect output
121 # Changes to be committed:
122 # new file: dir2/added
124 # Changes not staged for commit:
125 # modified: dir1/modified
136 test_expect_success
'status (advice.statusHints false)' '
137 test_when_finished "git config --unset advice.statusHints" &&
138 git config advice.statusHints false &&
139 git status >output &&
140 test_i18ncmp expect output
155 test_expect_success
'status -s' '
157 git status -s >output &&
158 test_cmp expect output
162 test_expect_success
'status with gitignore' '
170 cat >expect <<-\EOF &&
175 git status -s >output &&
176 test_cmp expect output &&
178 cat >expect <<-\EOF &&
189 git status -s --ignored >output &&
190 test_cmp expect output &&
192 cat >expect <<-\EOF &&
194 # Changes to be committed:
195 # (use "git reset HEAD <file>..." to unstage)
197 # new file: dir2/added
199 # Changes not staged for commit:
200 # (use "git add <file>..." to update what will be committed)
201 # (use "git checkout -- <file>..." to discard changes in working directory)
203 # modified: dir1/modified
206 # (use "git add <file>..." to include in what will be committed)
210 # (use "git add -f <file>..." to include in what will be committed)
219 git status --ignored >output &&
220 test_i18ncmp expect output
223 test_expect_success
'status with gitignore (nothing untracked)' '
227 echo "dir2/modified" &&
232 cat >expect <<-\EOF &&
236 git status -s >output &&
237 test_cmp expect output &&
239 cat >expect <<-\EOF &&
250 git status -s --ignored >output &&
251 test_cmp expect output &&
253 cat >expect <<-\EOF &&
255 # Changes to be committed:
256 # (use "git reset HEAD <file>..." to unstage)
258 # new file: dir2/added
260 # Changes not staged for commit:
261 # (use "git add <file>..." to update what will be committed)
262 # (use "git checkout -- <file>..." to discard changes in working directory)
264 # modified: dir1/modified
267 # (use "git add -f <file>..." to include in what will be committed)
277 git status --ignored >output &&
278 test_i18ncmp expect output
295 test_expect_success
'status -s -b' '
297 git status -s -b >output &&
298 test_cmp expect output
302 test_expect_success
'setup dir3' '
304 : >dir3/untracked1 &&
310 # Changes to be committed:
311 # (use "git reset HEAD <file>..." to unstage)
313 # new file: dir2/added
315 # Changes not staged for commit:
316 # (use "git add <file>..." to update what will be committed)
317 # (use "git checkout -- <file>..." to discard changes in working directory)
319 # modified: dir1/modified
321 # Untracked files not listed (use -u option to show untracked files)
323 test_expect_success
'status -uno' '
324 git status -uno >output &&
325 test_i18ncmp expect output
328 test_expect_success
'status (status.showUntrackedFiles no)' '
329 git config status.showuntrackedfiles no
330 test_when_finished "git config --unset status.showuntrackedfiles" &&
331 git status >output &&
332 test_i18ncmp expect output
337 # Changes to be committed:
338 # new file: dir2/added
340 # Changes not staged for commit:
341 # modified: dir1/modified
343 # Untracked files not listed
345 git config advice.statusHints false
346 test_expect_success
'status -uno (advice.statusHints false)' '
347 git status -uno >output &&
348 test_i18ncmp expect output
350 git config
--unset advice.statusHints
356 test_expect_success
'status -s -uno' '
357 git status -s -uno >output &&
358 test_cmp expect output
361 test_expect_success
'status -s (status.showUntrackedFiles no)' '
362 git config status.showuntrackedfiles no
363 git status -s >output &&
364 test_cmp expect output
369 # Changes to be committed:
370 # (use "git reset HEAD <file>..." to unstage)
372 # new file: dir2/added
374 # Changes not staged for commit:
375 # (use "git add <file>..." to update what will be committed)
376 # (use "git checkout -- <file>..." to discard changes in working directory)
378 # modified: dir1/modified
381 # (use "git add <file>..." to include in what will be committed)
391 test_expect_success
'status -unormal' '
392 git status -unormal >output &&
393 test_i18ncmp expect output
396 test_expect_success
'status (status.showUntrackedFiles normal)' '
397 git config status.showuntrackedfiles normal
398 test_when_finished "git config --unset status.showuntrackedfiles" &&
399 git status >output &&
400 test_i18ncmp expect output
414 test_expect_success
'status -s -unormal' '
415 git status -s -unormal >output &&
416 test_cmp expect output
419 test_expect_success
'status -s (status.showUntrackedFiles normal)' '
420 git config status.showuntrackedfiles normal
421 git status -s >output &&
422 test_cmp expect output
427 # Changes to be committed:
428 # (use "git reset HEAD <file>..." to unstage)
430 # new file: dir2/added
432 # Changes not staged for commit:
433 # (use "git add <file>..." to update what will be committed)
434 # (use "git checkout -- <file>..." to discard changes in working directory)
436 # modified: dir1/modified
439 # (use "git add <file>..." to include in what will be committed)
450 test_expect_success
'status -uall' '
451 git status -uall >output &&
452 test_i18ncmp expect output
455 test_expect_success
'status (status.showUntrackedFiles all)' '
456 git config status.showuntrackedfiles all
457 test_when_finished "git config --unset status.showuntrackedfiles" &&
458 git status >output &&
459 test_i18ncmp expect output
462 test_expect_success
'teardown dir3' '
476 test_expect_success
'status -s -uall' '
477 git config --unset status.showuntrackedfiles
478 git status -s -uall >output &&
479 test_cmp expect output
481 test_expect_success
'status -s (status.showUntrackedFiles all)' '
482 git config status.showuntrackedfiles all
483 git status -s >output &&
485 git config --unset status.showuntrackedfiles &&
486 test_cmp expect output
491 # Changes to be committed:
492 # (use "git reset HEAD <file>..." to unstage)
494 # new file: ../dir2/added
496 # Changes not staged for commit:
497 # (use "git add <file>..." to update what will be committed)
498 # (use "git checkout -- <file>..." to discard changes in working directory)
503 # (use "git add <file>..." to include in what will be committed)
513 test_expect_success
'status with relative paths' '
514 (cd dir1 && git status) >output &&
515 test_i18ncmp expect output
528 test_expect_success
'status -s with relative paths' '
530 (cd dir1 && git status -s) >output &&
531 test_cmp expect output
546 test_expect_success
'status --porcelain ignores relative paths setting' '
548 (cd dir1 && git status --porcelain) >output &&
549 test_cmp expect output
553 test_expect_success
'setup unique colors' '
555 git config status.color.untracked blue &&
556 git config status.color.branch green
561 # On branch <GREEN>master<RESET>
562 # Changes to be committed:
563 # (use "git reset HEAD <file>..." to unstage)
565 # <GREEN>new file: dir2/added<RESET>
567 # Changes not staged for commit:
568 # (use "git add <file>..." to update what will be committed)
569 # (use "git checkout -- <file>..." to discard changes in working directory)
571 # <RED>modified: dir1/modified<RESET>
574 # (use "git add <file>..." to include in what will be committed)
576 # <BLUE>dir1/untracked<RESET>
577 # <BLUE>dir2/modified<RESET>
578 # <BLUE>dir2/untracked<RESET>
579 # <BLUE>expect<RESET>
580 # <BLUE>output<RESET>
581 # <BLUE>untracked<RESET>
584 test_expect_success
'status with color.ui' '
585 git config color.ui always &&
586 test_when_finished "git config --unset color.ui" &&
587 git status | test_decode_color >output &&
588 test_i18ncmp expect output
591 test_expect_success
'status with color.status' '
592 git config color.status always &&
593 test_when_finished "git config --unset color.status" &&
594 git status | test_decode_color >output &&
595 test_i18ncmp expect output
599 <RED
>M
<RESET
> dir
1/modified
600 <GREEN
>A
<RESET
> dir
2/added
601 <BLUE
>??
<RESET
> dir
1/untracked
602 <BLUE
>??
<RESET
> dir
2/modified
603 <BLUE
>??
<RESET
> dir
2/untracked
604 <BLUE
>??
<RESET
> expect
605 <BLUE
>??
<RESET
> output
606 <BLUE
>??
<RESET
> untracked
609 test_expect_success
'status -s with color.ui' '
611 git config color.ui always &&
612 git status -s | test_decode_color >output &&
613 test_cmp expect output
617 test_expect_success
'status -s with color.status' '
619 git config --unset color.ui &&
620 git config color.status always &&
621 git status -s | test_decode_color >output &&
622 test_cmp expect output
627 ## <GREEN>master<RESET>
628 <RED
>M
<RESET
> dir
1/modified
629 <GREEN
>A
<RESET
> dir
2/added
630 <BLUE
>??
<RESET
> dir
1/untracked
631 <BLUE
>??
<RESET
> dir
2/modified
632 <BLUE
>??
<RESET
> dir
2/untracked
633 <BLUE
>??
<RESET
> expect
634 <BLUE
>??
<RESET
> output
635 <BLUE
>??
<RESET
> untracked
638 test_expect_success
'status -s -b with color.status' '
640 git status -s -b | test_decode_color >output &&
641 test_cmp expect output
656 test_expect_success
'status --porcelain ignores color.ui' '
658 git config --unset color.status &&
659 git config color.ui always &&
660 git status --porcelain | test_decode_color >output &&
661 test_cmp expect output
665 test_expect_success
'status --porcelain ignores color.status' '
667 git config --unset color.ui &&
668 git config color.status always &&
669 git status --porcelain | test_decode_color >output &&
670 test_cmp expect output
674 # recover unconditionally from color tests
675 git config
--unset color.status
676 git config
--unset color.ui
678 test_expect_success
'status --porcelain ignores -b' '
680 git status --porcelain -b >output &&
681 test_cmp expect output
687 # Changes to be committed:
688 # (use "git reset HEAD <file>..." to unstage)
690 # new file: dir2/added
692 # Changes not staged for commit:
693 # (use "git add <file>..." to update what will be committed)
694 # (use "git checkout -- <file>..." to discard changes in working directory)
696 # modified: dir1/modified
699 # (use "git add <file>..." to include in what will be committed)
710 test_expect_success
'status without relative paths' '
712 git config status.relativePaths false &&
713 test_when_finished "git config --unset status.relativePaths" &&
714 (cd dir1 && git status) >output &&
715 test_i18ncmp expect output
730 test_expect_success
'status -s without relative paths' '
732 git config status.relativePaths false &&
733 test_when_finished "git config --unset status.relativePaths" &&
734 (cd dir1 && git status -s) >output &&
735 test_cmp expect output
741 # Changes to be committed:
742 # (use "git reset HEAD <file>..." to unstage)
744 # modified: dir1/modified
747 # (use "git add <file>..." to include in what will be committed)
755 test_expect_success
'dry-run of partial commit excluding new file in index' '
756 git commit --dry-run dir1/modified >output &&
757 test_i18ncmp expect output
761 :100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 M dir1/modified
763 test_expect_success
'status refreshes the index' '
766 git diff-files >output &&
767 test_cmp expect output
770 test_expect_success
'setup status submodule summary' '
771 test_create_repo sm && (
775 git commit -m "Add foo"
782 # Changes to be committed:
783 # (use "git reset HEAD <file>..." to unstage)
785 # new file: dir2/added
788 # Changes not staged for commit:
789 # (use "git add <file>..." to update what will be committed)
790 # (use "git checkout -- <file>..." to discard changes in working directory)
792 # modified: dir1/modified
795 # (use "git add <file>..." to include in what will be committed)
804 test_expect_success
'status submodule summary is disabled by default' '
805 git status >output &&
806 test_i18ncmp expect output
809 # we expect the same as the previous test
810 test_expect_success
'status --untracked-files=all does not show submodule' '
811 git status --untracked-files=all >output &&
812 test_i18ncmp expect output
826 test_expect_success
'status -s submodule summary is disabled by default' '
827 git status -s >output &&
828 test_cmp expect output
831 # we expect the same as the previous test
832 test_expect_success
'status -s --untracked-files=all does not show submodule' '
833 git status -s --untracked-files=all >output &&
834 test_cmp expect output
837 head=$
(cd sm
&& git rev-parse
--short=7 --verify HEAD
)
841 # Changes to be committed:
842 # (use "git reset HEAD <file>..." to unstage)
844 # new file: dir2/added
847 # Changes not staged for commit:
848 # (use "git add <file>..." to update what will be committed)
849 # (use "git checkout -- <file>..." to discard changes in working directory)
851 # modified: dir1/modified
853 # Submodule changes to be committed:
855 # * sm 0000000...$head (1):
859 # (use "git add <file>..." to include in what will be committed)
868 test_expect_success
'status submodule summary' '
869 git config status.submodulesummary 10 &&
870 git status >output &&
871 test_i18ncmp expect output
885 test_expect_success
'status -s submodule summary' '
886 git status -s >output &&
887 test_cmp expect output
892 # Changes not staged for commit:
893 # (use "git add <file>..." to update what will be committed)
894 # (use "git checkout -- <file>..." to discard changes in working directory)
896 # modified: dir1/modified
899 # (use "git add <file>..." to include in what will be committed)
907 no changes added to commit (use "git add" and/or "git commit -a")
909 test_expect_success
'status submodule summary (clean submodule): commit' '
910 git commit -m "commit submodule" &&
911 git config status.submodulesummary 10 &&
912 test_must_fail git commit --dry-run >output &&
913 test_i18ncmp expect output &&
914 git status >output &&
915 test_i18ncmp expect output
927 test_expect_success
'status -s submodule summary (clean submodule)' '
928 git status -s >output &&
929 test_cmp expect output
932 test_expect_success
'status -z implies porcelain' '
933 git status --porcelain |
934 perl -pe "s/\012/\000/g" >expect &&
935 git status -z >output &&
936 test_cmp expect output
941 # Changes to be committed:
942 # (use "git reset HEAD^1 <file>..." to unstage)
944 # new file: dir2/added
947 # Changes not staged for commit:
948 # (use "git add <file>..." to update what will be committed)
949 # (use "git checkout -- <file>..." to discard changes in working directory)
951 # modified: dir1/modified
953 # Submodule changes to be committed:
955 # * sm 0000000...$head (1):
959 # (use "git add <file>..." to include in what will be committed)
968 test_expect_success
'commit --dry-run submodule summary (--amend)' '
969 git config status.submodulesummary 10 &&
970 git commit --dry-run --amend >output &&
971 test_i18ncmp expect output
974 test_expect_success POSIXPERM
,SANITY
'status succeeds in a read-only repository' '
977 # make dir1/tracked stat-dirty
978 >dir1/tracked1 && mv -f dir1/tracked1 dir1/tracked &&
979 git status -s >output &&
980 ! grep dir1/tracked output &&
981 # make sure "status" succeeded without writing index out
982 git diff-files | grep dir1/tracked
989 (cd sm
&& echo > bar
&& git add bar
&& git commit
-q -m 'Add bar') && git add sm
990 new_head
=$
(cd sm
&& git rev-parse
--short=7 --verify HEAD
)
995 # Changes to be committed:
996 # (use "git reset HEAD <file>..." to unstage)
1000 # Changes not staged for commit:
1001 # (use "git add <file>..." to update what will be committed)
1002 # (use "git checkout -- <file>..." to discard changes in working directory)
1004 # modified: dir1/modified
1006 # Submodule changes to be committed:
1008 # * sm $head...$new_head (1):
1012 # (use "git add <file>..." to include in what will be committed)
1023 test_expect_success
'--ignore-submodules=untracked suppresses submodules with untracked content' '
1024 echo modified sm/untracked &&
1025 git status --ignore-submodules=untracked >output &&
1026 test_i18ncmp expect output
1029 test_expect_success
'.gitmodules ignore=untracked suppresses submodules with untracked content' '
1030 git config diff.ignoreSubmodules dirty &&
1031 git status >output &&
1032 test_i18ncmp expect output &&
1033 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1034 git config --add -f .gitmodules submodule.subname.path sm &&
1035 git status >output &&
1036 test_i18ncmp expect output &&
1037 git config -f .gitmodules --remove-section submodule.subname &&
1038 git config --unset diff.ignoreSubmodules
1041 test_expect_success
'.git/config ignore=untracked suppresses submodules with untracked content' '
1042 git config --add -f .gitmodules submodule.subname.ignore none &&
1043 git config --add -f .gitmodules submodule.subname.path sm &&
1044 git config --add submodule.subname.ignore untracked &&
1045 git config --add submodule.subname.path sm &&
1046 git status >output &&
1047 test_i18ncmp expect output &&
1048 git config --remove-section submodule.subname &&
1049 git config --remove-section -f .gitmodules submodule.subname
1052 test_expect_success
'--ignore-submodules=dirty suppresses submodules with untracked content' '
1053 git status --ignore-submodules=dirty >output &&
1054 test_i18ncmp expect output
1057 test_expect_success
'.gitmodules ignore=dirty suppresses submodules with untracked content' '
1058 git config diff.ignoreSubmodules dirty &&
1059 git status >output &&
1061 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1062 git config --add -f .gitmodules submodule.subname.path sm &&
1063 git status >output &&
1064 test_i18ncmp expect output &&
1065 git config -f .gitmodules --remove-section submodule.subname &&
1066 git config --unset diff.ignoreSubmodules
1069 test_expect_success
'.git/config ignore=dirty suppresses submodules with untracked content' '
1070 git config --add -f .gitmodules submodule.subname.ignore none &&
1071 git config --add -f .gitmodules submodule.subname.path sm &&
1072 git config --add submodule.subname.ignore dirty &&
1073 git config --add submodule.subname.path sm &&
1074 git status >output &&
1075 test_i18ncmp expect output &&
1076 git config --remove-section submodule.subname &&
1077 git config -f .gitmodules --remove-section submodule.subname
1080 test_expect_success
'--ignore-submodules=dirty suppresses submodules with modified content' '
1081 echo modified >sm/foo &&
1082 git status --ignore-submodules=dirty >output &&
1083 test_i18ncmp expect output
1086 test_expect_success
'.gitmodules ignore=dirty suppresses submodules with modified content' '
1087 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1088 git config --add -f .gitmodules submodule.subname.path sm &&
1089 git status >output &&
1090 test_i18ncmp expect output &&
1091 git config -f .gitmodules --remove-section submodule.subname
1094 test_expect_success
'.git/config ignore=dirty suppresses submodules with modified content' '
1095 git config --add -f .gitmodules submodule.subname.ignore none &&
1096 git config --add -f .gitmodules submodule.subname.path sm &&
1097 git config --add submodule.subname.ignore dirty &&
1098 git config --add submodule.subname.path sm &&
1099 git status >output &&
1100 test_i18ncmp expect output &&
1101 git config --remove-section submodule.subname &&
1102 git config -f .gitmodules --remove-section submodule.subname
1107 # Changes to be committed:
1108 # (use "git reset HEAD <file>..." to unstage)
1112 # Changes not staged for commit:
1113 # (use "git add <file>..." to update what will be committed)
1114 # (use "git checkout -- <file>..." to discard changes in working directory)
1115 # (commit or discard the untracked or modified content in submodules)
1117 # modified: dir1/modified
1118 # modified: sm (modified content)
1120 # Submodule changes to be committed:
1122 # * sm $head...$new_head (1):
1126 # (use "git add <file>..." to include in what will be committed)
1137 test_expect_success
"--ignore-submodules=untracked doesn't suppress submodules with modified content" '
1138 git status --ignore-submodules=untracked > output &&
1139 test_i18ncmp expect output
1142 test_expect_success
".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
1143 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1144 git config --add -f .gitmodules submodule.subname.path sm &&
1145 git status >output &&
1146 test_i18ncmp expect output &&
1147 git config -f .gitmodules --remove-section submodule.subname
1150 test_expect_success
".git/config ignore=untracked doesn't suppress submodules with modified content" '
1151 git config --add -f .gitmodules submodule.subname.ignore none &&
1152 git config --add -f .gitmodules submodule.subname.path sm &&
1153 git config --add submodule.subname.ignore untracked &&
1154 git config --add submodule.subname.path sm &&
1155 git status >output &&
1156 test_i18ncmp expect output &&
1157 git config --remove-section submodule.subname &&
1158 git config -f .gitmodules --remove-section submodule.subname
1161 head2
=$
(cd sm
&& git commit
-q -m "2nd commit" foo
&& git rev-parse
--short=7 --verify HEAD
)
1165 # Changes to be committed:
1166 # (use "git reset HEAD <file>..." to unstage)
1170 # Changes not staged for commit:
1171 # (use "git add <file>..." to update what will be committed)
1172 # (use "git checkout -- <file>..." to discard changes in working directory)
1174 # modified: dir1/modified
1175 # modified: sm (new commits)
1177 # Submodule changes to be committed:
1179 # * sm $head...$new_head (1):
1182 # Submodules changed but not updated:
1184 # * sm $new_head...$head2 (1):
1188 # (use "git add <file>..." to include in what will be committed)
1199 test_expect_success
"--ignore-submodules=untracked doesn't suppress submodule summary" '
1200 git status --ignore-submodules=untracked > output &&
1201 test_i18ncmp expect output
1204 test_expect_success
".gitmodules ignore=untracked doesn't suppress submodule summary" '
1205 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1206 git config --add -f .gitmodules submodule.subname.path sm &&
1207 git status >output &&
1208 test_i18ncmp expect output &&
1209 git config -f .gitmodules --remove-section submodule.subname
1212 test_expect_success
".git/config ignore=untracked doesn't suppress submodule summary" '
1213 git config --add -f .gitmodules submodule.subname.ignore none &&
1214 git config --add -f .gitmodules submodule.subname.path sm &&
1215 git config --add submodule.subname.ignore untracked &&
1216 git config --add submodule.subname.path sm &&
1217 git status >output &&
1218 test_i18ncmp expect output &&
1219 git config --remove-section submodule.subname &&
1220 git config -f .gitmodules --remove-section submodule.subname
1223 test_expect_success
"--ignore-submodules=dirty doesn't suppress submodule summary" '
1224 git status --ignore-submodules=dirty > output &&
1225 test_i18ncmp expect output
1227 test_expect_success
".gitmodules ignore=dirty doesn't suppress submodule summary" '
1228 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1229 git config --add -f .gitmodules submodule.subname.path sm &&
1230 git status >output &&
1231 test_i18ncmp expect output &&
1232 git config -f .gitmodules --remove-section submodule.subname
1235 test_expect_success
".git/config ignore=dirty doesn't suppress submodule summary" '
1236 git config --add -f .gitmodules submodule.subname.ignore none &&
1237 git config --add -f .gitmodules submodule.subname.path sm &&
1238 git config --add submodule.subname.ignore dirty &&
1239 git config --add submodule.subname.path sm &&
1240 git status >output &&
1241 test_i18ncmp expect output &&
1242 git config --remove-section submodule.subname &&
1243 git config -f .gitmodules --remove-section submodule.subname
1248 # Changes not staged for commit:
1249 # (use "git add <file>..." to update what will be committed)
1250 # (use "git checkout -- <file>..." to discard changes in working directory)
1252 # modified: dir1/modified
1255 # (use "git add <file>..." to include in what will be committed)
1264 no changes added to commit (use "git add" and/or "git commit -a")
1267 test_expect_success
"--ignore-submodules=all suppresses submodule summary" '
1268 git status --ignore-submodules=all > output &&
1269 test_i18ncmp expect output
1272 test_expect_failure
'.gitmodules ignore=all suppresses submodule summary' '
1273 git config --add -f .gitmodules submodule.subname.ignore all &&
1274 git config --add -f .gitmodules submodule.subname.path sm &&
1275 git status > output &&
1276 test_cmp expect output &&
1277 git config -f .gitmodules --remove-section submodule.subname
1280 test_expect_failure
'.git/config ignore=all suppresses submodule summary' '
1281 git config --add -f .gitmodules submodule.subname.ignore none &&
1282 git config --add -f .gitmodules submodule.subname.path sm &&
1283 git config --add submodule.subname.ignore all &&
1284 git config --add submodule.subname.path sm &&
1285 git status > output &&
1286 test_cmp expect output &&
1287 git config --remove-section submodule.subname &&
1288 git config -f .gitmodules --remove-section submodule.subname