3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description='git status'
10 test_expect_success 'status -h in broken repository' '
11 git config --global advice.statusuoption false &&
13 test_when_finished "rm -fr broken" &&
17 echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
18 test_expect_code 129 git status -h >usage 2>&1
20 test_i18ngrep "[Uu]sage" broken/usage
23 test_expect_success 'commit -h in broken repository' '
25 test_when_finished "rm -fr broken" &&
29 echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
30 test_expect_code 129 git commit -h >usage 2>&1
32 test_i18ngrep "[Uu]sage" broken/usage
35 test_expect_success 'setup' '
49 git commit -m initial &&
53 echo 1 >dir1/modified &&
54 echo 2 >dir2/modified &&
59 test_expect_success 'status (1)' '
60 test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output
63 test_expect_success 'status --column' '
64 COLUMNS=50 git status --column="column dense" >output &&
67 # Changes to be committed:
68 # (use "git reset HEAD <file>..." to unstage)
70 # new file: dir2/added
72 # Changes not staged for commit:
73 # (use "git add <file>..." to update what will be committed)
74 # (use "git checkout -- <file>..." to discard changes in working directory)
76 # modified: dir1/modified
79 # (use "git add <file>..." to include in what will be committed)
81 # dir1/untracked dir2/untracked untracked
82 # dir2/modified output
84 test_i18ncmp expect output
89 # Changes to be committed:
90 # (use "git reset HEAD <file>..." to unstage)
92 # new file: dir2/added
94 # Changes not staged for commit:
95 # (use "git add <file>..." to update what will be committed)
96 # (use "git checkout -- <file>..." to discard changes in working directory)
98 # modified: dir1/modified
101 # (use "git add <file>..." to include in what will be committed)
111 test_expect_success 'status (2)' '
112 git status >output &&
113 test_i18ncmp expect output
118 # Changes to be committed:
119 # new file: dir2/added
121 # Changes not staged for commit:
122 # modified: dir1/modified
133 test_expect_success 'status (advice.statusHints false)' '
134 test_when_finished "git config --unset advice.statusHints" &&
135 git config advice.statusHints false &&
136 git status >output &&
137 test_i18ncmp expect output
152 test_expect_success 'status -s' '
154 git status -s >output &&
155 test_cmp expect output
159 test_expect_success 'status with gitignore' '
167 cat >expect <<-\EOF &&
172 git status -s >output &&
173 test_cmp expect output &&
175 cat >expect <<-\EOF &&
186 git status -s --ignored >output &&
187 test_cmp expect output &&
189 cat >expect <<-\EOF &&
191 # Changes to be committed:
192 # (use "git reset HEAD <file>..." to unstage)
194 # new file: dir2/added
196 # Changes not staged for commit:
197 # (use "git add <file>..." to update what will be committed)
198 # (use "git checkout -- <file>..." to discard changes in working directory)
200 # modified: dir1/modified
203 # (use "git add <file>..." to include in what will be committed)
207 # (use "git add -f <file>..." to include in what will be committed)
216 git status --ignored >output &&
217 test_i18ncmp expect output
220 test_expect_success 'status with gitignore (nothing untracked)' '
224 echo "dir2/modified" &&
229 cat >expect <<-\EOF &&
233 git status -s >output &&
234 test_cmp expect output &&
236 cat >expect <<-\EOF &&
247 git status -s --ignored >output &&
248 test_cmp expect output &&
250 cat >expect <<-\EOF &&
252 # Changes to be committed:
253 # (use "git reset HEAD <file>..." to unstage)
255 # new file: dir2/added
257 # Changes not staged for commit:
258 # (use "git add <file>..." to update what will be committed)
259 # (use "git checkout -- <file>..." to discard changes in working directory)
261 # modified: dir1/modified
264 # (use "git add -f <file>..." to include in what will be committed)
274 git status --ignored >output &&
275 test_i18ncmp expect output
292 test_expect_success 'status -s -b' '
294 git status -s -b >output &&
295 test_cmp expect output
299 test_expect_success 'status -s -z -b' '
300 tr "\\n" Q <expect >expect.q &&
301 mv expect.q expect &&
302 git status -s -z -b >output &&
303 nul_to_q <output >output.q &&
304 mv output.q output &&
305 test_cmp expect output
308 test_expect_success 'setup dir3' '
310 : >dir3/untracked1 &&
316 # Changes to be committed:
317 # (use "git reset HEAD <file>..." to unstage)
319 # new file: dir2/added
321 # Changes not staged for commit:
322 # (use "git add <file>..." to update what will be committed)
323 # (use "git checkout -- <file>..." to discard changes in working directory)
325 # modified: dir1/modified
327 # Untracked files not listed (use -u option to show untracked files)
329 test_expect_success 'status -uno' '
330 git status -uno >output &&
331 test_i18ncmp expect output
334 test_expect_success 'status (status.showUntrackedFiles no)' '
335 git config status.showuntrackedfiles no
336 test_when_finished "git config --unset status.showuntrackedfiles" &&
337 git status >output &&
338 test_i18ncmp expect output
343 # Changes to be committed:
344 # new file: dir2/added
346 # Changes not staged for commit:
347 # modified: dir1/modified
349 # Untracked files not listed
351 git config advice.statusHints false
352 test_expect_success 'status -uno (advice.statusHints false)' '
353 git status -uno >output &&
354 test_i18ncmp expect output
356 git config --unset advice.statusHints
362 test_expect_success 'status -s -uno' '
363 git status -s -uno >output &&
364 test_cmp expect output
367 test_expect_success 'status -s (status.showUntrackedFiles no)' '
368 git config status.showuntrackedfiles no
369 git status -s >output &&
370 test_cmp expect output
375 # Changes to be committed:
376 # (use "git reset HEAD <file>..." to unstage)
378 # new file: dir2/added
380 # Changes not staged for commit:
381 # (use "git add <file>..." to update what will be committed)
382 # (use "git checkout -- <file>..." to discard changes in working directory)
384 # modified: dir1/modified
387 # (use "git add <file>..." to include in what will be committed)
397 test_expect_success 'status -unormal' '
398 git status -unormal >output &&
399 test_i18ncmp expect output
402 test_expect_success 'status (status.showUntrackedFiles normal)' '
403 git config status.showuntrackedfiles normal
404 test_when_finished "git config --unset status.showuntrackedfiles" &&
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 git config status.showuntrackedfiles all
463 test_when_finished "git config --unset status.showuntrackedfiles" &&
464 git status >output &&
465 test_i18ncmp expect output
468 test_expect_success 'teardown dir3' '
482 test_expect_success 'status -s -uall' '
483 git config --unset status.showuntrackedfiles
484 git status -s -uall >output &&
485 test_cmp expect output
487 test_expect_success 'status -s (status.showUntrackedFiles all)' '
488 git config status.showuntrackedfiles all
489 git status -s >output &&
491 git config --unset status.showuntrackedfiles &&
492 test_cmp expect output
497 # Changes to be committed:
498 # (use "git reset HEAD <file>..." to unstage)
500 # new file: ../dir2/added
502 # Changes not staged for commit:
503 # (use "git add <file>..." to update what will be committed)
504 # (use "git checkout -- <file>..." to discard changes in working directory)
509 # (use "git add <file>..." to include in what will be committed)
519 test_expect_success 'status with relative paths' '
520 (cd dir1 && git status) >output &&
521 test_i18ncmp expect output
534 test_expect_success 'status -s with relative paths' '
536 (cd dir1 && git status -s) >output &&
537 test_cmp expect output
552 test_expect_success 'status --porcelain ignores relative paths setting' '
554 (cd dir1 && git status --porcelain) >output &&
555 test_cmp expect output
559 test_expect_success 'setup unique colors' '
561 git config status.color.untracked blue &&
562 git config status.color.branch green
567 # On branch <GREEN>master<RESET>
568 # Changes to be committed:
569 # (use "git reset HEAD <file>..." to unstage)
571 # <GREEN>new file: dir2/added<RESET>
573 # Changes not staged for commit:
574 # (use "git add <file>..." to update what will be committed)
575 # (use "git checkout -- <file>..." to discard changes in working directory)
577 # <RED>modified: dir1/modified<RESET>
580 # (use "git add <file>..." to include in what will be committed)
582 # <BLUE>dir1/untracked<RESET>
583 # <BLUE>dir2/modified<RESET>
584 # <BLUE>dir2/untracked<RESET>
585 # <BLUE>expect<RESET>
586 # <BLUE>output<RESET>
587 # <BLUE>untracked<RESET>
590 test_expect_success 'status with color.ui' '
591 git config color.ui always &&
592 test_when_finished "git config --unset color.ui" &&
593 git status | test_decode_color >output &&
594 test_i18ncmp expect output
597 test_expect_success 'status with color.status' '
598 git config color.status always &&
599 test_when_finished "git config --unset color.status" &&
600 git status | test_decode_color >output &&
601 test_i18ncmp expect output
605 <RED>M<RESET> dir1/modified
606 <GREEN>A<RESET> dir2/added
607 <BLUE>??<RESET> dir1/untracked
608 <BLUE>??<RESET> dir2/modified
609 <BLUE>??<RESET> dir2/untracked
610 <BLUE>??<RESET> expect
611 <BLUE>??<RESET> output
612 <BLUE>??<RESET> untracked
615 test_expect_success 'status -s with color.ui' '
617 git config color.ui always &&
618 git status -s | test_decode_color >output &&
619 test_cmp expect output
623 test_expect_success 'status -s with color.status' '
625 git config --unset color.ui &&
626 git config color.status always &&
627 git status -s | test_decode_color >output &&
628 test_cmp expect output
633 ## <GREEN>master<RESET>
634 <RED>M<RESET> dir1/modified
635 <GREEN>A<RESET> dir2/added
636 <BLUE>??<RESET> dir1/untracked
637 <BLUE>??<RESET> dir2/modified
638 <BLUE>??<RESET> dir2/untracked
639 <BLUE>??<RESET> expect
640 <BLUE>??<RESET> output
641 <BLUE>??<RESET> untracked
644 test_expect_success 'status -s -b with color.status' '
646 git status -s -b | test_decode_color >output &&
647 test_cmp expect output
662 test_expect_success 'status --porcelain ignores color.ui' '
664 git config --unset color.status &&
665 git config color.ui always &&
666 git status --porcelain | test_decode_color >output &&
667 test_cmp expect output
671 test_expect_success 'status --porcelain ignores color.status' '
673 git config --unset color.ui &&
674 git config color.status always &&
675 git status --porcelain | test_decode_color >output &&
676 test_cmp expect output
680 # recover unconditionally from color tests
681 git config --unset color.status
682 git config --unset color.ui
684 test_expect_success 'status --porcelain respects -b' '
686 git status --porcelain -b >output &&
692 test_cmp expect output
698 # Changes to be committed:
699 # (use "git reset HEAD <file>..." to unstage)
701 # new file: dir2/added
703 # Changes not staged for commit:
704 # (use "git add <file>..." to update what will be committed)
705 # (use "git checkout -- <file>..." to discard changes in working directory)
707 # modified: dir1/modified
710 # (use "git add <file>..." to include in what will be committed)
721 test_expect_success 'status without relative paths' '
723 git config status.relativePaths false &&
724 test_when_finished "git config --unset status.relativePaths" &&
725 (cd dir1 && git status) >output &&
726 test_i18ncmp expect output
741 test_expect_success 'status -s without relative paths' '
743 git config status.relativePaths false &&
744 test_when_finished "git config --unset status.relativePaths" &&
745 (cd dir1 && git status -s) >output &&
746 test_cmp expect output
752 # Changes to be committed:
753 # (use "git reset HEAD <file>..." to unstage)
755 # modified: dir1/modified
758 # (use "git add <file>..." to include in what will be committed)
766 test_expect_success 'dry-run of partial commit excluding new file in index' '
767 git commit --dry-run dir1/modified >output &&
768 test_i18ncmp expect output
772 :100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 M dir1/modified
774 test_expect_success 'status refreshes the index' '
777 git diff-files >output &&
778 test_cmp expect output
781 test_expect_success 'setup status submodule summary' '
782 test_create_repo sm && (
786 git commit -m "Add foo"
793 # Changes to be committed:
794 # (use "git reset HEAD <file>..." to unstage)
796 # new file: dir2/added
799 # Changes not staged for commit:
800 # (use "git add <file>..." to update what will be committed)
801 # (use "git checkout -- <file>..." to discard changes in working directory)
803 # modified: dir1/modified
806 # (use "git add <file>..." to include in what will be committed)
815 test_expect_success 'status submodule summary is disabled by default' '
816 git status >output &&
817 test_i18ncmp expect output
820 # we expect the same as the previous test
821 test_expect_success 'status --untracked-files=all does not show submodule' '
822 git status --untracked-files=all >output &&
823 test_i18ncmp expect output
837 test_expect_success 'status -s submodule summary is disabled by default' '
838 git status -s >output &&
839 test_cmp expect output
842 # we expect the same as the previous test
843 test_expect_success 'status -s --untracked-files=all does not show submodule' '
844 git status -s --untracked-files=all >output &&
845 test_cmp expect output
848 head=$(cd sm && git rev-parse --short=7 --verify HEAD)
852 # Changes to be committed:
853 # (use "git reset HEAD <file>..." to unstage)
855 # new file: dir2/added
858 # Changes not staged for commit:
859 # (use "git add <file>..." to update what will be committed)
860 # (use "git checkout -- <file>..." to discard changes in working directory)
862 # modified: dir1/modified
864 # Submodule changes to be committed:
866 # * sm 0000000...$head (1):
870 # (use "git add <file>..." to include in what will be committed)
879 test_expect_success 'status submodule summary' '
880 git config status.submodulesummary 10 &&
881 git status >output &&
882 test_i18ncmp expect output
896 test_expect_success 'status -s submodule summary' '
897 git status -s >output &&
898 test_cmp expect output
903 # Changes not staged for commit:
904 # (use "git add <file>..." to update what will be committed)
905 # (use "git checkout -- <file>..." to discard changes in working directory)
907 # modified: dir1/modified
910 # (use "git add <file>..." to include in what will be committed)
918 no changes added to commit (use "git add" and/or "git commit -a")
920 test_expect_success 'status submodule summary (clean submodule): commit' '
921 git commit -m "commit submodule" &&
922 git config status.submodulesummary 10 &&
923 test_must_fail git commit --dry-run >output &&
924 test_i18ncmp expect output &&
925 git status >output &&
926 test_i18ncmp expect output
938 test_expect_success 'status -s submodule summary (clean submodule)' '
939 git status -s >output &&
940 test_cmp expect output
943 test_expect_success 'status -z implies porcelain' '
944 git status --porcelain |
945 "$PERL_PATH" -pe "s/\012/\000/g" >expect &&
946 git status -z >output &&
947 test_cmp expect output
952 # Changes to be committed:
953 # (use "git reset HEAD^1 <file>..." to unstage)
955 # new file: dir2/added
958 # Changes not staged for commit:
959 # (use "git add <file>..." to update what will be committed)
960 # (use "git checkout -- <file>..." to discard changes in working directory)
962 # modified: dir1/modified
964 # Submodule changes to be committed:
966 # * sm 0000000...$head (1):
970 # (use "git add <file>..." to include in what will be committed)
979 test_expect_success 'commit --dry-run submodule summary (--amend)' '
980 git config status.submodulesummary 10 &&
981 git commit --dry-run --amend >output &&
982 test_i18ncmp expect output
985 test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository' '
988 # make dir1/tracked stat-dirty
989 >dir1/tracked1 && mv -f dir1/tracked1 dir1/tracked &&
990 git status -s >output &&
991 ! grep dir1/tracked output &&
992 # make sure "status" succeeded without writing index out
993 git diff-files | grep dir1/tracked
1000 (cd sm && echo > bar && git add bar && git commit -q -m 'Add bar') && git add sm
1001 new_head=$(cd sm && git rev-parse --short=7 --verify HEAD)
1006 # Changes to be committed:
1007 # (use "git reset HEAD <file>..." to unstage)
1011 # Changes not staged for commit:
1012 # (use "git add <file>..." to update what will be committed)
1013 # (use "git checkout -- <file>..." to discard changes in working directory)
1015 # modified: dir1/modified
1017 # Submodule changes to be committed:
1019 # * sm $head...$new_head (1):
1023 # (use "git add <file>..." to include in what will be committed)
1034 test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
1035 echo modified sm/untracked &&
1036 git status --ignore-submodules=untracked >output &&
1037 test_i18ncmp expect output
1040 test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
1041 git config diff.ignoreSubmodules dirty &&
1042 git status >output &&
1043 test_i18ncmp expect output &&
1044 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1045 git config --add -f .gitmodules submodule.subname.path sm &&
1046 git status >output &&
1047 test_i18ncmp expect output &&
1048 git config -f .gitmodules --remove-section submodule.subname &&
1049 git config --unset diff.ignoreSubmodules
1052 test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
1053 git config --add -f .gitmodules submodule.subname.ignore none &&
1054 git config --add -f .gitmodules submodule.subname.path sm &&
1055 git config --add submodule.subname.ignore untracked &&
1056 git config --add submodule.subname.path sm &&
1057 git status >output &&
1058 test_i18ncmp expect output &&
1059 git config --remove-section submodule.subname &&
1060 git config --remove-section -f .gitmodules submodule.subname
1063 test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '
1064 git status --ignore-submodules=dirty >output &&
1065 test_i18ncmp expect output
1068 test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
1069 git config diff.ignoreSubmodules dirty &&
1070 git status >output &&
1072 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1073 git config --add -f .gitmodules submodule.subname.path sm &&
1074 git status >output &&
1075 test_i18ncmp expect output &&
1076 git config -f .gitmodules --remove-section submodule.subname &&
1077 git config --unset diff.ignoreSubmodules
1080 test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
1081 git config --add -f .gitmodules submodule.subname.ignore none &&
1082 git config --add -f .gitmodules submodule.subname.path sm &&
1083 git config --add submodule.subname.ignore dirty &&
1084 git config --add submodule.subname.path sm &&
1085 git status >output &&
1086 test_i18ncmp expect output &&
1087 git config --remove-section submodule.subname &&
1088 git config -f .gitmodules --remove-section submodule.subname
1091 test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '
1092 echo modified >sm/foo &&
1093 git status --ignore-submodules=dirty >output &&
1094 test_i18ncmp expect output
1097 test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '
1098 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1099 git config --add -f .gitmodules submodule.subname.path sm &&
1100 git status >output &&
1101 test_i18ncmp expect output &&
1102 git config -f .gitmodules --remove-section submodule.subname
1105 test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '
1106 git config --add -f .gitmodules submodule.subname.ignore none &&
1107 git config --add -f .gitmodules submodule.subname.path sm &&
1108 git config --add submodule.subname.ignore dirty &&
1109 git config --add submodule.subname.path sm &&
1110 git status >output &&
1111 test_i18ncmp expect output &&
1112 git config --remove-section submodule.subname &&
1113 git config -f .gitmodules --remove-section submodule.subname
1118 # Changes to be committed:
1119 # (use "git reset HEAD <file>..." to unstage)
1123 # Changes not staged for commit:
1124 # (use "git add <file>..." to update what will be committed)
1125 # (use "git checkout -- <file>..." to discard changes in working directory)
1126 # (commit or discard the untracked or modified content in submodules)
1128 # modified: dir1/modified
1129 # modified: sm (modified content)
1131 # Submodule changes to be committed:
1133 # * sm $head...$new_head (1):
1137 # (use "git add <file>..." to include in what will be committed)
1148 test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
1149 git status --ignore-submodules=untracked > output &&
1150 test_i18ncmp expect output
1153 test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
1154 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1155 git config --add -f .gitmodules submodule.subname.path sm &&
1156 git status >output &&
1157 test_i18ncmp expect output &&
1158 git config -f .gitmodules --remove-section submodule.subname
1161 test_expect_success ".git/config ignore=untracked doesn't suppress submodules with modified content" '
1162 git config --add -f .gitmodules submodule.subname.ignore none &&
1163 git config --add -f .gitmodules submodule.subname.path sm &&
1164 git config --add submodule.subname.ignore untracked &&
1165 git config --add submodule.subname.path sm &&
1166 git status >output &&
1167 test_i18ncmp expect output &&
1168 git config --remove-section submodule.subname &&
1169 git config -f .gitmodules --remove-section submodule.subname
1172 head2=$(cd sm && git commit -q -m "2nd commit" foo && git rev-parse --short=7 --verify HEAD)
1176 # Changes to be committed:
1177 # (use "git reset HEAD <file>..." to unstage)
1181 # Changes not staged for commit:
1182 # (use "git add <file>..." to update what will be committed)
1183 # (use "git checkout -- <file>..." to discard changes in working directory)
1185 # modified: dir1/modified
1186 # modified: sm (new commits)
1188 # Submodule changes to be committed:
1190 # * sm $head...$new_head (1):
1193 # Submodules changed but not updated:
1195 # * sm $new_head...$head2 (1):
1199 # (use "git add <file>..." to include in what will be committed)
1210 test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
1211 git status --ignore-submodules=untracked > output &&
1212 test_i18ncmp expect output
1215 test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule summary" '
1216 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1217 git config --add -f .gitmodules submodule.subname.path sm &&
1218 git status >output &&
1219 test_i18ncmp expect output &&
1220 git config -f .gitmodules --remove-section submodule.subname
1223 test_expect_success ".git/config ignore=untracked doesn't suppress submodule summary" '
1224 git config --add -f .gitmodules submodule.subname.ignore none &&
1225 git config --add -f .gitmodules submodule.subname.path sm &&
1226 git config --add submodule.subname.ignore untracked &&
1227 git config --add submodule.subname.path sm &&
1228 git status >output &&
1229 test_i18ncmp expect output &&
1230 git config --remove-section submodule.subname &&
1231 git config -f .gitmodules --remove-section submodule.subname
1234 test_expect_success "--ignore-submodules=dirty doesn't suppress submodule summary" '
1235 git status --ignore-submodules=dirty > output &&
1236 test_i18ncmp expect output
1238 test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary" '
1239 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1240 git config --add -f .gitmodules submodule.subname.path sm &&
1241 git status >output &&
1242 test_i18ncmp expect output &&
1243 git config -f .gitmodules --remove-section submodule.subname
1246 test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary" '
1247 git config --add -f .gitmodules submodule.subname.ignore none &&
1248 git config --add -f .gitmodules submodule.subname.path sm &&
1249 git config --add submodule.subname.ignore dirty &&
1250 git config --add submodule.subname.path sm &&
1251 git status >output &&
1252 test_i18ncmp expect output &&
1253 git config --remove-section submodule.subname &&
1254 git config -f .gitmodules --remove-section submodule.subname
1259 ; Changes to be committed:
1260 ; (use "git reset HEAD <file>..." to unstage)
1264 ; Changes not staged for commit:
1265 ; (use "git add <file>..." to update what will be committed)
1266 ; (use "git checkout -- <file>..." to discard changes in working directory)
1268 ; modified: dir1/modified
1269 ; modified: sm (new commits)
1271 ; Submodule changes to be committed:
1273 ; * sm $head...$new_head (1):
1276 ; Submodules changed but not updated:
1278 ; * sm $new_head...$head2 (1):
1282 ; (use "git add <file>..." to include in what will be committed)
1293 test_expect_success "status (core.commentchar with submodule summary)" '
1294 test_when_finished "git config --unset core.commentchar" &&
1295 git config core.commentchar ";" &&
1296 git status >output &&
1297 test_i18ncmp expect output
1300 test_expect_success "status (core.commentchar with two chars with submodule summary)" '
1301 test_when_finished "git config --unset core.commentchar" &&
1302 git config core.commentchar ";;" &&
1303 git status >output &&
1304 test_i18ncmp expect output
1309 # Changes not staged for commit:
1310 # (use "git add <file>..." to update what will be committed)
1311 # (use "git checkout -- <file>..." to discard changes in working directory)
1313 # modified: dir1/modified
1316 # (use "git add <file>..." to include in what will be committed)
1325 no changes added to commit (use "git add" and/or "git commit -a")
1328 test_expect_success "--ignore-submodules=all suppresses submodule summary" '
1329 git status --ignore-submodules=all > output &&
1330 test_i18ncmp expect output
1333 test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '
1334 git config --add -f .gitmodules submodule.subname.ignore all &&
1335 git config --add -f .gitmodules submodule.subname.path sm &&
1336 git status > output &&
1337 test_cmp expect output &&
1338 git config -f .gitmodules --remove-section submodule.subname
1341 test_expect_failure '.git/config ignore=all suppresses submodule summary' '
1342 git config --add -f .gitmodules submodule.subname.ignore none &&
1343 git config --add -f .gitmodules submodule.subname.path sm &&
1344 git config --add submodule.subname.ignore all &&
1345 git config --add submodule.subname.path sm &&
1346 git status > output &&
1347 test_cmp expect output &&
1348 git config --remove-section submodule.subname &&
1349 git config -f .gitmodules --remove-section submodule.subname