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' '
15 git config --global advice.statusuoption false &&
17 test_when_finished "rm -fr broken" &&
21 echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
22 test_expect_code 129 git status -h >usage 2>&1
24 test_i18ngrep "[Uu]sage" broken/usage
27 test_expect_success
'commit -h in broken repository' '
29 test_when_finished "rm -fr broken" &&
33 echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
34 test_expect_code 129 git commit -h >usage 2>&1
36 test_i18ngrep "[Uu]sage" broken/usage
39 test_expect_success
'setup' '
53 git commit -m initial &&
57 echo 1 >dir1/modified &&
58 echo 2 >dir2/modified &&
63 test_expect_success
'status (1)' '
64 test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output
67 test_expect_success
'status --column' '
68 COLUMNS=50 git status --column="column dense" >output &&
71 # Changes to be committed:
72 # (use "git reset HEAD <file>..." to unstage)
74 # new file: dir2/added
76 # Changes not staged for commit:
77 # (use "git add <file>..." to update what will be committed)
78 # (use "git checkout -- <file>..." to discard changes in working directory)
80 # modified: dir1/modified
83 # (use "git add <file>..." to include in what will be committed)
85 # dir1/untracked dir2/untracked untracked
86 # dir2/modified output
88 test_i18ncmp expect output
93 # Changes to be committed:
94 # (use "git reset HEAD <file>..." to unstage)
96 # new file: dir2/added
98 # Changes not staged for commit:
99 # (use "git add <file>..." to update what will be committed)
100 # (use "git checkout -- <file>..." to discard changes in working directory)
102 # modified: dir1/modified
105 # (use "git add <file>..." to include in what will be committed)
115 test_expect_success
'status (2)' '
116 git status >output &&
117 test_i18ncmp expect output
122 # Changes to be committed:
123 # new file: dir2/added
125 # Changes not staged for commit:
126 # modified: dir1/modified
137 test_expect_success
'status (advice.statusHints false)' '
138 test_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
'status -s -z -b' '
303 tr "\\n" Q <expect >expect.q &&
304 mv expect.q expect &&
305 git status -s -z -b >output &&
306 nul_to_q <output >output.q &&
307 mv output.q output &&
308 test_cmp expect output
311 test_expect_success
'setup dir3' '
313 : >dir3/untracked1 &&
319 # Changes to be committed:
320 # (use "git reset HEAD <file>..." to unstage)
322 # new file: dir2/added
324 # Changes not staged for commit:
325 # (use "git add <file>..." to update what will be committed)
326 # (use "git checkout -- <file>..." to discard changes in working directory)
328 # modified: dir1/modified
330 # Untracked files not listed (use -u option to show untracked files)
332 test_expect_success
'status -uno' '
333 git status -uno >output &&
334 test_i18ncmp expect output
337 test_expect_success
'status (status.showUntrackedFiles no)' '
338 test_config status.showuntrackedfiles no &&
339 git status >output &&
340 test_i18ncmp expect output
345 # Changes to be committed:
346 # new file: dir2/added
348 # Changes not staged for commit:
349 # modified: dir1/modified
351 # Untracked files not listed
353 test_expect_success
'status -uno (advice.statusHints false)' '
354 test_config advice.statusHints false &&
355 git status -uno >output &&
356 test_i18ncmp expect output
363 test_expect_success
'status -s -uno' '
364 git status -s -uno >output &&
365 test_cmp expect output
368 test_expect_success
'status -s (status.showUntrackedFiles no)' '
369 git config status.showuntrackedfiles no
370 git status -s >output &&
371 test_cmp expect output
376 # Changes to be committed:
377 # (use "git reset HEAD <file>..." to unstage)
379 # new file: dir2/added
381 # Changes not staged for commit:
382 # (use "git add <file>..." to update what will be committed)
383 # (use "git checkout -- <file>..." to discard changes in working directory)
385 # modified: dir1/modified
388 # (use "git add <file>..." to include in what will be committed)
398 test_expect_success
'status -unormal' '
399 git status -unormal >output &&
400 test_i18ncmp expect output
403 test_expect_success
'status (status.showUntrackedFiles normal)' '
404 test_config status.showuntrackedfiles normal
405 git status >output &&
406 test_i18ncmp expect output
420 test_expect_success
'status -s -unormal' '
421 git status -s -unormal >output &&
422 test_cmp expect output
425 test_expect_success
'status -s (status.showUntrackedFiles normal)' '
426 git config status.showuntrackedfiles normal
427 git status -s >output &&
428 test_cmp expect output
433 # Changes to be committed:
434 # (use "git reset HEAD <file>..." to unstage)
436 # new file: dir2/added
438 # Changes not staged for commit:
439 # (use "git add <file>..." to update what will be committed)
440 # (use "git checkout -- <file>..." to discard changes in working directory)
442 # modified: dir1/modified
445 # (use "git add <file>..." to include in what will be committed)
456 test_expect_success
'status -uall' '
457 git status -uall >output &&
458 test_i18ncmp expect output
461 test_expect_success
'status (status.showUntrackedFiles all)' '
462 test_config status.showuntrackedfiles all
463 git status >output &&
464 test_i18ncmp expect output
467 test_expect_success
'teardown dir3' '
481 test_expect_success
'status -s -uall' '
482 git config --unset status.showuntrackedfiles
483 git status -s -uall >output &&
484 test_cmp expect output
486 test_expect_success
'status -s (status.showUntrackedFiles all)' '
487 test_config status.showuntrackedfiles all &&
488 git status -s >output &&
490 test_cmp expect output
495 # Changes to be committed:
496 # (use "git reset HEAD <file>..." to unstage)
498 # new file: ../dir2/added
500 # Changes not staged for commit:
501 # (use "git add <file>..." to update what will be committed)
502 # (use "git checkout -- <file>..." to discard changes in working directory)
507 # (use "git add <file>..." to include in what will be committed)
517 test_expect_success
'status with relative paths' '
518 (cd dir1 && git status) >output &&
519 test_i18ncmp expect output
532 test_expect_success
'status -s with relative paths' '
534 (cd dir1 && git status -s) >output &&
535 test_cmp expect output
550 test_expect_success
'status --porcelain ignores relative paths setting' '
552 (cd dir1 && git status --porcelain) >output &&
553 test_cmp expect output
557 test_expect_success
'setup unique colors' '
559 git config status.color.untracked blue &&
560 git config status.color.branch green
565 # On branch <GREEN>master<RESET>
566 # Changes to be committed:
567 # (use "git reset HEAD <file>..." to unstage)
569 # <GREEN>new file: dir2/added<RESET>
571 # Changes not staged for commit:
572 # (use "git add <file>..." to update what will be committed)
573 # (use "git checkout -- <file>..." to discard changes in working directory)
575 # <RED>modified: dir1/modified<RESET>
578 # (use "git add <file>..." to include in what will be committed)
580 # <BLUE>dir1/untracked<RESET>
581 # <BLUE>dir2/modified<RESET>
582 # <BLUE>dir2/untracked<RESET>
583 # <BLUE>expect<RESET>
584 # <BLUE>output<RESET>
585 # <BLUE>untracked<RESET>
588 test_expect_success
'status with color.ui' '
589 test_config color.ui always &&
590 git status | test_decode_color >output &&
591 test_i18ncmp expect output
594 test_expect_success
'status with color.status' '
595 test_config color.status always &&
596 git status | test_decode_color >output &&
597 test_i18ncmp expect output
601 <RED
>M
<RESET
> dir
1/modified
602 <GREEN
>A
<RESET
> dir
2/added
603 <BLUE
>??
<RESET
> dir
1/untracked
604 <BLUE
>??
<RESET
> dir
2/modified
605 <BLUE
>??
<RESET
> dir
2/untracked
606 <BLUE
>??
<RESET
> expect
607 <BLUE
>??
<RESET
> output
608 <BLUE
>??
<RESET
> untracked
611 test_expect_success
'status -s with color.ui' '
613 git config color.ui always &&
614 git status -s | test_decode_color >output &&
615 test_cmp expect output
619 test_expect_success
'status -s with color.status' '
621 git config --unset color.ui &&
622 git config color.status always &&
623 git status -s | test_decode_color >output &&
624 test_cmp expect output
629 ## <GREEN>master<RESET>
630 <RED
>M
<RESET
> dir
1/modified
631 <GREEN
>A
<RESET
> dir
2/added
632 <BLUE
>??
<RESET
> dir
1/untracked
633 <BLUE
>??
<RESET
> dir
2/modified
634 <BLUE
>??
<RESET
> dir
2/untracked
635 <BLUE
>??
<RESET
> expect
636 <BLUE
>??
<RESET
> output
637 <BLUE
>??
<RESET
> untracked
640 test_expect_success
'status -s -b with color.status' '
642 git status -s -b | test_decode_color >output &&
643 test_cmp expect output
658 test_expect_success
'status --porcelain ignores color.ui' '
660 git config --unset color.status &&
661 git config color.ui always &&
662 git status --porcelain | test_decode_color >output &&
663 test_cmp expect output
667 test_expect_success
'status --porcelain ignores color.status' '
669 git config --unset color.ui &&
670 git config color.status always &&
671 git status --porcelain | test_decode_color >output &&
672 test_cmp expect output
676 # recover unconditionally from color tests
677 git config
--unset color.status
678 git config
--unset color.ui
680 test_expect_success
'status --porcelain respects -b' '
682 git status --porcelain -b >output &&
688 test_cmp expect output
694 # Changes to be committed:
695 # (use "git reset HEAD <file>..." to unstage)
697 # new file: dir2/added
699 # Changes not staged for commit:
700 # (use "git add <file>..." to update what will be committed)
701 # (use "git checkout -- <file>..." to discard changes in working directory)
703 # modified: dir1/modified
706 # (use "git add <file>..." to include in what will be committed)
717 test_expect_success
'status without relative paths' '
719 test_config status.relativePaths false &&
720 (cd dir1 && git status) >output &&
721 test_i18ncmp expect output
736 test_expect_success
'status -s without relative paths' '
738 test_config status.relativePaths false &&
739 (cd dir1 && git status -s) >output &&
740 test_cmp expect output
746 # Changes to be committed:
747 # (use "git reset HEAD <file>..." to unstage)
749 # modified: dir1/modified
752 # (use "git add <file>..." to include in what will be committed)
760 test_expect_success
'dry-run of partial commit excluding new file in index' '
761 git commit --dry-run dir1/modified >output &&
762 test_i18ncmp expect output
766 :100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 M dir1/modified
768 test_expect_success
'status refreshes the index' '
771 git diff-files >output &&
772 test_cmp expect output
775 test_expect_success
'setup status submodule summary' '
776 test_create_repo sm && (
780 git commit -m "Add foo"
787 # Changes to be committed:
788 # (use "git reset HEAD <file>..." to unstage)
790 # new file: dir2/added
793 # Changes not staged for commit:
794 # (use "git add <file>..." to update what will be committed)
795 # (use "git checkout -- <file>..." to discard changes in working directory)
797 # modified: dir1/modified
800 # (use "git add <file>..." to include in what will be committed)
809 test_expect_success
'status submodule summary is disabled by default' '
810 git status >output &&
811 test_i18ncmp expect output
814 # we expect the same as the previous test
815 test_expect_success
'status --untracked-files=all does not show submodule' '
816 git status --untracked-files=all >output &&
817 test_i18ncmp expect output
831 test_expect_success
'status -s submodule summary is disabled by default' '
832 git status -s >output &&
833 test_cmp expect output
836 # we expect the same as the previous test
837 test_expect_success
'status -s --untracked-files=all does not show submodule' '
838 git status -s --untracked-files=all >output &&
839 test_cmp expect output
842 head=$
(cd sm
&& git rev-parse
--short=7 --verify HEAD
)
846 # Changes to be committed:
847 # (use "git reset HEAD <file>..." to unstage)
849 # new file: dir2/added
852 # Changes not staged for commit:
853 # (use "git add <file>..." to update what will be committed)
854 # (use "git checkout -- <file>..." to discard changes in working directory)
856 # modified: dir1/modified
858 # Submodule changes to be committed:
860 # * sm 0000000...$head (1):
864 # (use "git add <file>..." to include in what will be committed)
873 test_expect_success
'status submodule summary' '
874 git config status.submodulesummary 10 &&
875 git status >output &&
876 test_i18ncmp expect output
890 test_expect_success
'status -s submodule summary' '
891 git status -s >output &&
892 test_cmp expect output
897 # Changes not staged for commit:
898 # (use "git add <file>..." to update what will be committed)
899 # (use "git checkout -- <file>..." to discard changes in working directory)
901 # modified: dir1/modified
904 # (use "git add <file>..." to include in what will be committed)
912 no changes added to commit (use "git add" and/or "git commit -a")
914 test_expect_success
'status submodule summary (clean submodule): commit' '
915 git commit -m "commit submodule" &&
916 git config status.submodulesummary 10 &&
917 test_must_fail git commit --dry-run >output &&
918 test_i18ncmp expect output &&
919 git status >output &&
920 test_i18ncmp expect output
932 test_expect_success
'status -s submodule summary (clean submodule)' '
933 git status -s >output &&
934 test_cmp expect output
937 test_expect_success
'status -z implies porcelain' '
938 git status --porcelain |
939 "$PERL_PATH" -pe "s/\012/\000/g" >expect &&
940 git status -z >output &&
941 test_cmp expect output
946 # Changes to be committed:
947 # (use "git reset HEAD^1 <file>..." to unstage)
949 # new file: dir2/added
952 # Changes not staged for commit:
953 # (use "git add <file>..." to update what will be committed)
954 # (use "git checkout -- <file>..." to discard changes in working directory)
956 # modified: dir1/modified
958 # Submodule changes to be committed:
960 # * sm 0000000...$head (1):
964 # (use "git add <file>..." to include in what will be committed)
973 test_expect_success
'commit --dry-run submodule summary (--amend)' '
974 git config status.submodulesummary 10 &&
975 git commit --dry-run --amend >output &&
976 test_i18ncmp expect output
979 test_expect_success POSIXPERM
,SANITY
'status succeeds in a read-only repository' '
982 # make dir1/tracked stat-dirty
983 >dir1/tracked1 && mv -f dir1/tracked1 dir1/tracked &&
984 git status -s >output &&
985 ! grep dir1/tracked output &&
986 # make sure "status" succeeded without writing index out
987 git diff-files | grep dir1/tracked
994 (cd sm
&& echo > bar
&& git add bar
&& git commit
-q -m 'Add bar') && git add sm
995 new_head
=$
(cd sm
&& git rev-parse
--short=7 --verify HEAD
)
1000 # Changes to be committed:
1001 # (use "git reset HEAD <file>..." to unstage)
1005 # Changes not staged for commit:
1006 # (use "git add <file>..." to update what will be committed)
1007 # (use "git checkout -- <file>..." to discard changes in working directory)
1009 # modified: dir1/modified
1011 # Submodule changes to be committed:
1013 # * sm $head...$new_head (1):
1017 # (use "git add <file>..." to include in what will be committed)
1028 test_expect_success
'--ignore-submodules=untracked suppresses submodules with untracked content' '
1029 echo modified sm/untracked &&
1030 git status --ignore-submodules=untracked >output &&
1031 test_i18ncmp expect output
1034 test_expect_success
'.gitmodules ignore=untracked suppresses submodules with untracked content' '
1035 test_config diff.ignoreSubmodules dirty &&
1036 git status >output &&
1037 test_i18ncmp expect output &&
1038 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1039 git config --add -f .gitmodules submodule.subname.path sm &&
1040 git status >output &&
1041 test_i18ncmp expect output &&
1042 git config -f .gitmodules --remove-section submodule.subname
1045 test_expect_success
'.git/config ignore=untracked suppresses submodules with untracked content' '
1046 git config --add -f .gitmodules submodule.subname.ignore none &&
1047 git config --add -f .gitmodules submodule.subname.path sm &&
1048 git config --add submodule.subname.ignore untracked &&
1049 git config --add submodule.subname.path sm &&
1050 git status >output &&
1051 test_i18ncmp expect output &&
1052 git config --remove-section submodule.subname &&
1053 git config --remove-section -f .gitmodules submodule.subname
1056 test_expect_success
'--ignore-submodules=dirty suppresses submodules with untracked content' '
1057 git status --ignore-submodules=dirty >output &&
1058 test_i18ncmp expect output
1061 test_expect_success
'.gitmodules ignore=dirty suppresses submodules with untracked content' '
1062 test_config diff.ignoreSubmodules dirty &&
1063 git status >output &&
1065 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1066 git config --add -f .gitmodules submodule.subname.path sm &&
1067 git status >output &&
1068 test_i18ncmp expect output &&
1069 git config -f .gitmodules --remove-section submodule.subname
1072 test_expect_success
'.git/config ignore=dirty suppresses submodules with untracked content' '
1073 git config --add -f .gitmodules submodule.subname.ignore none &&
1074 git config --add -f .gitmodules submodule.subname.path sm &&
1075 git config --add submodule.subname.ignore dirty &&
1076 git config --add submodule.subname.path sm &&
1077 git status >output &&
1078 test_i18ncmp expect output &&
1079 git config --remove-section submodule.subname &&
1080 git config -f .gitmodules --remove-section submodule.subname
1083 test_expect_success
'--ignore-submodules=dirty suppresses submodules with modified content' '
1084 echo modified >sm/foo &&
1085 git status --ignore-submodules=dirty >output &&
1086 test_i18ncmp expect output
1089 test_expect_success
'.gitmodules ignore=dirty suppresses submodules with modified content' '
1090 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1091 git config --add -f .gitmodules submodule.subname.path sm &&
1092 git status >output &&
1093 test_i18ncmp expect output &&
1094 git config -f .gitmodules --remove-section submodule.subname
1097 test_expect_success
'.git/config ignore=dirty suppresses submodules with modified content' '
1098 git config --add -f .gitmodules submodule.subname.ignore none &&
1099 git config --add -f .gitmodules submodule.subname.path sm &&
1100 git config --add submodule.subname.ignore dirty &&
1101 git config --add submodule.subname.path sm &&
1102 git status >output &&
1103 test_i18ncmp expect output &&
1104 git config --remove-section submodule.subname &&
1105 git config -f .gitmodules --remove-section submodule.subname
1110 # Changes to be committed:
1111 # (use "git reset HEAD <file>..." to unstage)
1115 # Changes not staged for commit:
1116 # (use "git add <file>..." to update what will be committed)
1117 # (use "git checkout -- <file>..." to discard changes in working directory)
1118 # (commit or discard the untracked or modified content in submodules)
1120 # modified: dir1/modified
1121 # modified: sm (modified content)
1123 # Submodule changes to be committed:
1125 # * sm $head...$new_head (1):
1129 # (use "git add <file>..." to include in what will be committed)
1140 test_expect_success
"--ignore-submodules=untracked doesn't suppress submodules with modified content" '
1141 git status --ignore-submodules=untracked > output &&
1142 test_i18ncmp expect output
1145 test_expect_success
".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
1146 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1147 git config --add -f .gitmodules submodule.subname.path sm &&
1148 git status >output &&
1149 test_i18ncmp expect output &&
1150 git config -f .gitmodules --remove-section submodule.subname
1153 test_expect_success
".git/config ignore=untracked doesn't suppress submodules with modified content" '
1154 git config --add -f .gitmodules submodule.subname.ignore none &&
1155 git config --add -f .gitmodules submodule.subname.path sm &&
1156 git config --add submodule.subname.ignore untracked &&
1157 git config --add submodule.subname.path sm &&
1158 git status >output &&
1159 test_i18ncmp expect output &&
1160 git config --remove-section submodule.subname &&
1161 git config -f .gitmodules --remove-section submodule.subname
1164 head2
=$
(cd sm
&& git commit
-q -m "2nd commit" foo
&& git rev-parse
--short=7 --verify HEAD
)
1168 # Changes to be committed:
1169 # (use "git reset HEAD <file>..." to unstage)
1173 # Changes not staged for commit:
1174 # (use "git add <file>..." to update what will be committed)
1175 # (use "git checkout -- <file>..." to discard changes in working directory)
1177 # modified: dir1/modified
1178 # modified: sm (new commits)
1180 # Submodule changes to be committed:
1182 # * sm $head...$new_head (1):
1185 # Submodules changed but not updated:
1187 # * sm $new_head...$head2 (1):
1191 # (use "git add <file>..." to include in what will be committed)
1202 test_expect_success
"--ignore-submodules=untracked doesn't suppress submodule summary" '
1203 git status --ignore-submodules=untracked > output &&
1204 test_i18ncmp expect output
1207 test_expect_success
".gitmodules ignore=untracked doesn't suppress submodule summary" '
1208 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1209 git config --add -f .gitmodules submodule.subname.path sm &&
1210 git status >output &&
1211 test_i18ncmp expect output &&
1212 git config -f .gitmodules --remove-section submodule.subname
1215 test_expect_success
".git/config ignore=untracked doesn't suppress submodule summary" '
1216 git config --add -f .gitmodules submodule.subname.ignore none &&
1217 git config --add -f .gitmodules submodule.subname.path sm &&
1218 git config --add submodule.subname.ignore untracked &&
1219 git config --add submodule.subname.path sm &&
1220 git status >output &&
1221 test_i18ncmp expect output &&
1222 git config --remove-section submodule.subname &&
1223 git config -f .gitmodules --remove-section submodule.subname
1226 test_expect_success
"--ignore-submodules=dirty doesn't suppress submodule summary" '
1227 git status --ignore-submodules=dirty > output &&
1228 test_i18ncmp expect output
1230 test_expect_success
".gitmodules ignore=dirty doesn't suppress submodule summary" '
1231 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1232 git config --add -f .gitmodules submodule.subname.path sm &&
1233 git status >output &&
1234 test_i18ncmp expect output &&
1235 git config -f .gitmodules --remove-section submodule.subname
1238 test_expect_success
".git/config ignore=dirty doesn't suppress submodule summary" '
1239 git config --add -f .gitmodules submodule.subname.ignore none &&
1240 git config --add -f .gitmodules submodule.subname.path sm &&
1241 git config --add submodule.subname.ignore dirty &&
1242 git config --add submodule.subname.path sm &&
1243 git status >output &&
1244 test_i18ncmp expect output &&
1245 git config --remove-section submodule.subname &&
1246 git config -f .gitmodules --remove-section submodule.subname
1251 ; Changes to be committed:
1252 ; (use "git reset HEAD <file>..." to unstage)
1256 ; Changes not staged for commit:
1257 ; (use "git add <file>..." to update what will be committed)
1258 ; (use "git checkout -- <file>..." to discard changes in working directory)
1260 ; modified: dir1/modified
1261 ; modified: sm (new commits)
1263 ; Submodule changes to be committed:
1265 ; * sm $head...$new_head (1):
1268 ; Submodules changed but not updated:
1270 ; * sm $new_head...$head2 (1):
1274 ; (use "git add <file>..." to include in what will be committed)
1285 test_expect_success
"status (core.commentchar with submodule summary)" '
1286 test_config core.commentchar ";" &&
1287 git status >output &&
1288 test_i18ncmp expect output
1291 test_expect_success
"status (core.commentchar with two chars with submodule summary)" '
1292 test_config core.commentchar ";;" &&
1293 git status >output &&
1294 test_i18ncmp expect output
1299 # Changes not staged for commit:
1300 # (use "git add <file>..." to update what will be committed)
1301 # (use "git checkout -- <file>..." to discard changes in working directory)
1303 # modified: dir1/modified
1306 # (use "git add <file>..." to include in what will be committed)
1315 no changes added to commit (use "git add" and/or "git commit -a")
1318 test_expect_success
"--ignore-submodules=all suppresses submodule summary" '
1319 git status --ignore-submodules=all > output &&
1320 test_i18ncmp expect output
1323 test_expect_failure
'.gitmodules ignore=all suppresses submodule summary' '
1324 git config --add -f .gitmodules submodule.subname.ignore all &&
1325 git config --add -f .gitmodules submodule.subname.path sm &&
1326 git status > output &&
1327 test_cmp expect output &&
1328 git config -f .gitmodules --remove-section submodule.subname
1331 test_expect_failure
'.git/config ignore=all suppresses submodule summary' '
1332 git config --add -f .gitmodules submodule.subname.ignore none &&
1333 git config --add -f .gitmodules submodule.subname.path sm &&
1334 git config --add submodule.subname.ignore all &&
1335 git config --add submodule.subname.path sm &&
1336 git status > output &&
1337 test_cmp expect output &&
1338 git config --remove-section submodule.subname &&
1339 git config -f .gitmodules --remove-section submodule.subname