3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description='git status'
10 test_expect_success 'status -h in broken repository' '
12 test_when_finished "rm -fr broken" &&
16 echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
17 test_expect_code 129 git status -h >usage 2>&1
19 test_i18ngrep "[Uu]sage" broken/usage
22 test_expect_success 'commit -h in broken repository' '
24 test_when_finished "rm -fr broken" &&
28 echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
29 test_expect_code 129 git commit -h >usage 2>&1
31 test_i18ngrep "[Uu]sage" broken/usage
34 test_expect_success 'setup' '
48 git commit -m initial &&
52 echo 1 >dir1/modified &&
53 echo 2 >dir2/modified &&
58 test_expect_success 'status (1)' '
59 test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output
62 test_expect_success 'status --column' '
63 COLUMNS=50 git status --column="column dense" >output &&
66 # Changes to be committed:
67 # (use "git reset HEAD <file>..." to unstage)
69 # new file: dir2/added
71 # Changes not staged for commit:
72 # (use "git add <file>..." to update what will be committed)
73 # (use "git checkout -- <file>..." to discard changes in working directory)
75 # modified: dir1/modified
78 # (use "git add <file>..." to include in what will be committed)
80 # dir1/untracked dir2/untracked untracked
81 # dir2/modified output
83 test_i18ncmp expect output
88 # Changes to be committed:
89 # (use "git reset HEAD <file>..." to unstage)
91 # new file: dir2/added
93 # Changes not staged for commit:
94 # (use "git add <file>..." to update what will be committed)
95 # (use "git checkout -- <file>..." to discard changes in working directory)
97 # modified: dir1/modified
100 # (use "git add <file>..." to include in what will be committed)
110 test_expect_success 'status (2)' '
111 git status >output &&
112 test_i18ncmp expect output
117 # Changes to be committed:
118 # new file: dir2/added
120 # Changes not staged for commit:
121 # modified: dir1/modified
132 test_expect_success 'status (advice.statusHints false)' '
133 test_when_finished "git config --unset advice.statusHints" &&
134 git config advice.statusHints false &&
135 git status >output &&
136 test_i18ncmp expect output
151 test_expect_success 'status -s' '
153 git status -s >output &&
154 test_cmp expect output
158 test_expect_success 'status with gitignore' '
166 cat >expect <<-\EOF &&
171 git status -s >output &&
172 test_cmp expect output &&
174 cat >expect <<-\EOF &&
185 git status -s --ignored >output &&
186 test_cmp expect output &&
188 cat >expect <<-\EOF &&
190 # Changes to be committed:
191 # (use "git reset HEAD <file>..." to unstage)
193 # new file: dir2/added
195 # Changes not staged for commit:
196 # (use "git add <file>..." to update what will be committed)
197 # (use "git checkout -- <file>..." to discard changes in working directory)
199 # modified: dir1/modified
202 # (use "git add <file>..." to include in what will be committed)
206 # (use "git add -f <file>..." to include in what will be committed)
215 git status --ignored >output &&
216 test_i18ncmp expect output
219 test_expect_success 'status with gitignore (nothing untracked)' '
223 echo "dir2/modified" &&
228 cat >expect <<-\EOF &&
232 git status -s >output &&
233 test_cmp expect output &&
235 cat >expect <<-\EOF &&
246 git status -s --ignored >output &&
247 test_cmp expect output &&
249 cat >expect <<-\EOF &&
251 # Changes to be committed:
252 # (use "git reset HEAD <file>..." to unstage)
254 # new file: dir2/added
256 # Changes not staged for commit:
257 # (use "git add <file>..." to update what will be committed)
258 # (use "git checkout -- <file>..." to discard changes in working directory)
260 # modified: dir1/modified
263 # (use "git add -f <file>..." to include in what will be committed)
273 git status --ignored >output &&
274 test_i18ncmp expect output
291 test_expect_success 'status -s -b' '
293 git status -s -b >output &&
294 test_cmp expect output
298 test_expect_success 'status -s -z -b' '
299 tr "\\n" Q <expect >expect.q &&
300 mv expect.q expect &&
301 git status -s -z -b >output &&
302 nul_to_q <output >output.q &&
303 mv output.q output &&
304 test_cmp expect output
307 test_expect_success 'setup dir3' '
309 : >dir3/untracked1 &&
315 # Changes to be committed:
316 # (use "git reset HEAD <file>..." to unstage)
318 # new file: dir2/added
320 # Changes not staged for commit:
321 # (use "git add <file>..." to update what will be committed)
322 # (use "git checkout -- <file>..." to discard changes in working directory)
324 # modified: dir1/modified
326 # Untracked files not listed (use -u option to show untracked files)
328 test_expect_success 'status -uno' '
329 git status -uno >output &&
330 test_i18ncmp expect output
333 test_expect_success 'status (status.showUntrackedFiles no)' '
334 git config status.showuntrackedfiles no
335 test_when_finished "git config --unset status.showuntrackedfiles" &&
336 git status >output &&
337 test_i18ncmp expect output
342 # Changes to be committed:
343 # new file: dir2/added
345 # Changes not staged for commit:
346 # modified: dir1/modified
348 # Untracked files not listed
350 git config advice.statusHints false
351 test_expect_success 'status -uno (advice.statusHints false)' '
352 git status -uno >output &&
353 test_i18ncmp expect output
355 git config --unset advice.statusHints
361 test_expect_success 'status -s -uno' '
362 git status -s -uno >output &&
363 test_cmp expect output
366 test_expect_success 'status -s (status.showUntrackedFiles no)' '
367 git config status.showuntrackedfiles no
368 git status -s >output &&
369 test_cmp expect output
374 # Changes to be committed:
375 # (use "git reset HEAD <file>..." to unstage)
377 # new file: dir2/added
379 # Changes not staged for commit:
380 # (use "git add <file>..." to update what will be committed)
381 # (use "git checkout -- <file>..." to discard changes in working directory)
383 # modified: dir1/modified
386 # (use "git add <file>..." to include in what will be committed)
396 test_expect_success 'status -unormal' '
397 git status -unormal >output &&
398 test_i18ncmp expect output
401 test_expect_success 'status (status.showUntrackedFiles normal)' '
402 git config status.showuntrackedfiles normal
403 test_when_finished "git config --unset status.showuntrackedfiles" &&
404 git status >output &&
405 test_i18ncmp expect output
419 test_expect_success 'status -s -unormal' '
420 git status -s -unormal >output &&
421 test_cmp expect output
424 test_expect_success 'status -s (status.showUntrackedFiles normal)' '
425 git config status.showuntrackedfiles normal
426 git status -s >output &&
427 test_cmp expect output
432 # Changes to be committed:
433 # (use "git reset HEAD <file>..." to unstage)
435 # new file: dir2/added
437 # Changes not staged for commit:
438 # (use "git add <file>..." to update what will be committed)
439 # (use "git checkout -- <file>..." to discard changes in working directory)
441 # modified: dir1/modified
444 # (use "git add <file>..." to include in what will be committed)
455 test_expect_success 'status -uall' '
456 git status -uall >output &&
457 test_i18ncmp expect output
460 test_expect_success 'status (status.showUntrackedFiles all)' '
461 git config status.showuntrackedfiles all
462 test_when_finished "git config --unset status.showuntrackedfiles" &&
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 git config status.showuntrackedfiles all
488 git status -s >output &&
490 git config --unset status.showuntrackedfiles &&
491 test_cmp expect output
496 # Changes to be committed:
497 # (use "git reset HEAD <file>..." to unstage)
499 # new file: ../dir2/added
501 # Changes not staged for commit:
502 # (use "git add <file>..." to update what will be committed)
503 # (use "git checkout -- <file>..." to discard changes in working directory)
508 # (use "git add <file>..." to include in what will be committed)
518 test_expect_success 'status with relative paths' '
519 (cd dir1 && git status) >output &&
520 test_i18ncmp expect output
533 test_expect_success 'status -s with relative paths' '
535 (cd dir1 && git status -s) >output &&
536 test_cmp expect output
551 test_expect_success 'status --porcelain ignores relative paths setting' '
553 (cd dir1 && git status --porcelain) >output &&
554 test_cmp expect output
558 test_expect_success 'setup unique colors' '
560 git config status.color.untracked blue &&
561 git config status.color.branch green
566 # On branch <GREEN>master<RESET>
567 # Changes to be committed:
568 # (use "git reset HEAD <file>..." to unstage)
570 # <GREEN>new file: dir2/added<RESET>
572 # Changes not staged for commit:
573 # (use "git add <file>..." to update what will be committed)
574 # (use "git checkout -- <file>..." to discard changes in working directory)
576 # <RED>modified: dir1/modified<RESET>
579 # (use "git add <file>..." to include in what will be committed)
581 # <BLUE>dir1/untracked<RESET>
582 # <BLUE>dir2/modified<RESET>
583 # <BLUE>dir2/untracked<RESET>
584 # <BLUE>expect<RESET>
585 # <BLUE>output<RESET>
586 # <BLUE>untracked<RESET>
589 test_expect_success 'status with color.ui' '
590 git config color.ui always &&
591 test_when_finished "git config --unset color.ui" &&
592 git status | test_decode_color >output &&
593 test_i18ncmp expect output
596 test_expect_success 'status with color.status' '
597 git config color.status always &&
598 test_when_finished "git config --unset color.status" &&
599 git status | test_decode_color >output &&
600 test_i18ncmp expect output
604 <RED>M<RESET> dir1/modified
605 <GREEN>A<RESET> dir2/added
606 <BLUE>??<RESET> dir1/untracked
607 <BLUE>??<RESET> dir2/modified
608 <BLUE>??<RESET> dir2/untracked
609 <BLUE>??<RESET> expect
610 <BLUE>??<RESET> output
611 <BLUE>??<RESET> untracked
614 test_expect_success 'status -s with color.ui' '
616 git config color.ui always &&
617 git status -s | test_decode_color >output &&
618 test_cmp expect output
622 test_expect_success 'status -s with color.status' '
624 git config --unset color.ui &&
625 git config color.status always &&
626 git status -s | test_decode_color >output &&
627 test_cmp expect output
632 ## <GREEN>master<RESET>
633 <RED>M<RESET> dir1/modified
634 <GREEN>A<RESET> dir2/added
635 <BLUE>??<RESET> dir1/untracked
636 <BLUE>??<RESET> dir2/modified
637 <BLUE>??<RESET> dir2/untracked
638 <BLUE>??<RESET> expect
639 <BLUE>??<RESET> output
640 <BLUE>??<RESET> untracked
643 test_expect_success 'status -s -b with color.status' '
645 git status -s -b | test_decode_color >output &&
646 test_cmp expect output
661 test_expect_success 'status --porcelain ignores color.ui' '
663 git config --unset color.status &&
664 git config color.ui always &&
665 git status --porcelain | test_decode_color >output &&
666 test_cmp expect output
670 test_expect_success 'status --porcelain ignores color.status' '
672 git config --unset color.ui &&
673 git config color.status always &&
674 git status --porcelain | test_decode_color >output &&
675 test_cmp expect output
679 # recover unconditionally from color tests
680 git config --unset color.status
681 git config --unset color.ui
683 test_expect_success 'status --porcelain respects -b' '
685 git status --porcelain -b >output &&
691 test_cmp expect output
697 # Changes to be committed:
698 # (use "git reset HEAD <file>..." to unstage)
700 # new file: dir2/added
702 # Changes not staged for commit:
703 # (use "git add <file>..." to update what will be committed)
704 # (use "git checkout -- <file>..." to discard changes in working directory)
706 # modified: dir1/modified
709 # (use "git add <file>..." to include in what will be committed)
720 test_expect_success 'status without relative paths' '
722 git config status.relativePaths false &&
723 test_when_finished "git config --unset status.relativePaths" &&
724 (cd dir1 && git status) >output &&
725 test_i18ncmp expect output
740 test_expect_success 'status -s without relative paths' '
742 git config status.relativePaths false &&
743 test_when_finished "git config --unset status.relativePaths" &&
744 (cd dir1 && git status -s) >output &&
745 test_cmp expect output
751 # Changes to be committed:
752 # (use "git reset HEAD <file>..." to unstage)
754 # modified: dir1/modified
757 # (use "git add <file>..." to include in what will be committed)
765 test_expect_success 'dry-run of partial commit excluding new file in index' '
766 git commit --dry-run dir1/modified >output &&
767 test_i18ncmp expect output
771 :100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 M dir1/modified
773 test_expect_success 'status refreshes the index' '
776 git diff-files >output &&
777 test_cmp expect output
780 test_expect_success 'setup status submodule summary' '
781 test_create_repo sm && (
785 git commit -m "Add foo"
792 # Changes to be committed:
793 # (use "git reset HEAD <file>..." to unstage)
795 # new file: dir2/added
798 # Changes not staged for commit:
799 # (use "git add <file>..." to update what will be committed)
800 # (use "git checkout -- <file>..." to discard changes in working directory)
802 # modified: dir1/modified
805 # (use "git add <file>..." to include in what will be committed)
814 test_expect_success 'status submodule summary is disabled by default' '
815 git status >output &&
816 test_i18ncmp expect output
819 # we expect the same as the previous test
820 test_expect_success 'status --untracked-files=all does not show submodule' '
821 git status --untracked-files=all >output &&
822 test_i18ncmp expect output
836 test_expect_success 'status -s submodule summary is disabled by default' '
837 git status -s >output &&
838 test_cmp expect output
841 # we expect the same as the previous test
842 test_expect_success 'status -s --untracked-files=all does not show submodule' '
843 git status -s --untracked-files=all >output &&
844 test_cmp expect output
847 head=$(cd sm && git rev-parse --short=7 --verify HEAD)
851 # Changes to be committed:
852 # (use "git reset HEAD <file>..." to unstage)
854 # new file: dir2/added
857 # Changes not staged for commit:
858 # (use "git add <file>..." to update what will be committed)
859 # (use "git checkout -- <file>..." to discard changes in working directory)
861 # modified: dir1/modified
863 # Submodule changes to be committed:
865 # * sm 0000000...$head (1):
869 # (use "git add <file>..." to include in what will be committed)
878 test_expect_success 'status submodule summary' '
879 git config status.submodulesummary 10 &&
880 git status >output &&
881 test_i18ncmp expect output
895 test_expect_success 'status -s submodule summary' '
896 git status -s >output &&
897 test_cmp expect output
902 # Changes not staged for commit:
903 # (use "git add <file>..." to update what will be committed)
904 # (use "git checkout -- <file>..." to discard changes in working directory)
906 # modified: dir1/modified
909 # (use "git add <file>..." to include in what will be committed)
917 no changes added to commit (use "git add" and/or "git commit -a")
919 test_expect_success 'status submodule summary (clean submodule): commit' '
920 git commit -m "commit submodule" &&
921 git config status.submodulesummary 10 &&
922 test_must_fail git commit --dry-run >output &&
923 test_i18ncmp expect output &&
924 git status >output &&
925 test_i18ncmp expect output
937 test_expect_success 'status -s submodule summary (clean submodule)' '
938 git status -s >output &&
939 test_cmp expect output
942 test_expect_success 'status -z implies porcelain' '
943 git status --porcelain |
944 "$PERL_PATH" -pe "s/\012/\000/g" >expect &&
945 git status -z >output &&
946 test_cmp expect output
951 # Changes to be committed:
952 # (use "git reset HEAD^1 <file>..." to unstage)
954 # new file: dir2/added
957 # Changes not staged for commit:
958 # (use "git add <file>..." to update what will be committed)
959 # (use "git checkout -- <file>..." to discard changes in working directory)
961 # modified: dir1/modified
963 # Submodule changes to be committed:
965 # * sm 0000000...$head (1):
969 # (use "git add <file>..." to include in what will be committed)
978 test_expect_success 'commit --dry-run submodule summary (--amend)' '
979 git config status.submodulesummary 10 &&
980 git commit --dry-run --amend >output &&
981 test_i18ncmp expect output
984 test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository' '
987 # make dir1/tracked stat-dirty
988 >dir1/tracked1 && mv -f dir1/tracked1 dir1/tracked &&
989 git status -s >output &&
990 ! grep dir1/tracked output &&
991 # make sure "status" succeeded without writing index out
992 git diff-files | grep dir1/tracked
999 (cd sm && echo > bar && git add bar && git commit -q -m 'Add bar') && git add sm
1000 new_head=$(cd sm && git rev-parse --short=7 --verify HEAD)
1005 # Changes to be committed:
1006 # (use "git reset HEAD <file>..." to unstage)
1010 # Changes not staged for commit:
1011 # (use "git add <file>..." to update what will be committed)
1012 # (use "git checkout -- <file>..." to discard changes in working directory)
1014 # modified: dir1/modified
1016 # Submodule changes to be committed:
1018 # * sm $head...$new_head (1):
1022 # (use "git add <file>..." to include in what will be committed)
1033 test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
1034 echo modified sm/untracked &&
1035 git status --ignore-submodules=untracked >output &&
1036 test_i18ncmp expect output
1039 test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
1040 git config diff.ignoreSubmodules dirty &&
1041 git status >output &&
1042 test_i18ncmp expect output &&
1043 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1044 git config --add -f .gitmodules submodule.subname.path sm &&
1045 git status >output &&
1046 test_i18ncmp expect output &&
1047 git config -f .gitmodules --remove-section submodule.subname &&
1048 git config --unset diff.ignoreSubmodules
1051 test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
1052 git config --add -f .gitmodules submodule.subname.ignore none &&
1053 git config --add -f .gitmodules submodule.subname.path sm &&
1054 git config --add submodule.subname.ignore untracked &&
1055 git config --add submodule.subname.path sm &&
1056 git status >output &&
1057 test_i18ncmp expect output &&
1058 git config --remove-section submodule.subname &&
1059 git config --remove-section -f .gitmodules submodule.subname
1062 test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '
1063 git status --ignore-submodules=dirty >output &&
1064 test_i18ncmp expect output
1067 test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
1068 git config diff.ignoreSubmodules dirty &&
1069 git status >output &&
1071 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1072 git config --add -f .gitmodules submodule.subname.path sm &&
1073 git status >output &&
1074 test_i18ncmp expect output &&
1075 git config -f .gitmodules --remove-section submodule.subname &&
1076 git config --unset diff.ignoreSubmodules
1079 test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
1080 git config --add -f .gitmodules submodule.subname.ignore none &&
1081 git config --add -f .gitmodules submodule.subname.path sm &&
1082 git config --add submodule.subname.ignore dirty &&
1083 git config --add submodule.subname.path sm &&
1084 git status >output &&
1085 test_i18ncmp expect output &&
1086 git config --remove-section submodule.subname &&
1087 git config -f .gitmodules --remove-section submodule.subname
1090 test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '
1091 echo modified >sm/foo &&
1092 git status --ignore-submodules=dirty >output &&
1093 test_i18ncmp expect output
1096 test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '
1097 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1098 git config --add -f .gitmodules submodule.subname.path sm &&
1099 git status >output &&
1100 test_i18ncmp expect output &&
1101 git config -f .gitmodules --remove-section submodule.subname
1104 test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '
1105 git config --add -f .gitmodules submodule.subname.ignore none &&
1106 git config --add -f .gitmodules submodule.subname.path sm &&
1107 git config --add submodule.subname.ignore dirty &&
1108 git config --add submodule.subname.path sm &&
1109 git status >output &&
1110 test_i18ncmp expect output &&
1111 git config --remove-section submodule.subname &&
1112 git config -f .gitmodules --remove-section submodule.subname
1117 # Changes to be committed:
1118 # (use "git reset HEAD <file>..." to unstage)
1122 # Changes not staged for commit:
1123 # (use "git add <file>..." to update what will be committed)
1124 # (use "git checkout -- <file>..." to discard changes in working directory)
1125 # (commit or discard the untracked or modified content in submodules)
1127 # modified: dir1/modified
1128 # modified: sm (modified content)
1130 # Submodule changes to be committed:
1132 # * sm $head...$new_head (1):
1136 # (use "git add <file>..." to include in what will be committed)
1147 test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
1148 git status --ignore-submodules=untracked > output &&
1149 test_i18ncmp expect output
1152 test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
1153 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1154 git config --add -f .gitmodules submodule.subname.path sm &&
1155 git status >output &&
1156 test_i18ncmp expect output &&
1157 git config -f .gitmodules --remove-section submodule.subname
1160 test_expect_success ".git/config ignore=untracked doesn't suppress submodules with modified content" '
1161 git config --add -f .gitmodules submodule.subname.ignore none &&
1162 git config --add -f .gitmodules submodule.subname.path sm &&
1163 git config --add submodule.subname.ignore untracked &&
1164 git config --add submodule.subname.path sm &&
1165 git status >output &&
1166 test_i18ncmp expect output &&
1167 git config --remove-section submodule.subname &&
1168 git config -f .gitmodules --remove-section submodule.subname
1171 head2=$(cd sm && git commit -q -m "2nd commit" foo && git rev-parse --short=7 --verify HEAD)
1175 # Changes to be committed:
1176 # (use "git reset HEAD <file>..." to unstage)
1180 # Changes not staged for commit:
1181 # (use "git add <file>..." to update what will be committed)
1182 # (use "git checkout -- <file>..." to discard changes in working directory)
1184 # modified: dir1/modified
1185 # modified: sm (new commits)
1187 # Submodule changes to be committed:
1189 # * sm $head...$new_head (1):
1192 # Submodules changed but not updated:
1194 # * sm $new_head...$head2 (1):
1198 # (use "git add <file>..." to include in what will be committed)
1209 test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
1210 git status --ignore-submodules=untracked > output &&
1211 test_i18ncmp expect output
1214 test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule summary" '
1215 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1216 git config --add -f .gitmodules submodule.subname.path sm &&
1217 git status >output &&
1218 test_i18ncmp expect output &&
1219 git config -f .gitmodules --remove-section submodule.subname
1222 test_expect_success ".git/config ignore=untracked doesn't suppress submodule summary" '
1223 git config --add -f .gitmodules submodule.subname.ignore none &&
1224 git config --add -f .gitmodules submodule.subname.path sm &&
1225 git config --add submodule.subname.ignore untracked &&
1226 git config --add submodule.subname.path sm &&
1227 git status >output &&
1228 test_i18ncmp expect output &&
1229 git config --remove-section submodule.subname &&
1230 git config -f .gitmodules --remove-section submodule.subname
1233 test_expect_success "--ignore-submodules=dirty doesn't suppress submodule summary" '
1234 git status --ignore-submodules=dirty > output &&
1235 test_i18ncmp expect output
1237 test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary" '
1238 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1239 git config --add -f .gitmodules submodule.subname.path sm &&
1240 git status >output &&
1241 test_i18ncmp expect output &&
1242 git config -f .gitmodules --remove-section submodule.subname
1245 test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary" '
1246 git config --add -f .gitmodules submodule.subname.ignore none &&
1247 git config --add -f .gitmodules submodule.subname.path sm &&
1248 git config --add submodule.subname.ignore dirty &&
1249 git config --add submodule.subname.path sm &&
1250 git status >output &&
1251 test_i18ncmp expect output &&
1252 git config --remove-section submodule.subname &&
1253 git config -f .gitmodules --remove-section submodule.subname
1258 # Changes not staged for commit:
1259 # (use "git add <file>..." to update what will be committed)
1260 # (use "git checkout -- <file>..." to discard changes in working directory)
1262 # modified: dir1/modified
1265 # (use "git add <file>..." to include in what will be committed)
1274 no changes added to commit (use "git add" and/or "git commit -a")
1277 test_expect_success "--ignore-submodules=all suppresses submodule summary" '
1278 git status --ignore-submodules=all > output &&
1279 test_i18ncmp expect output
1282 test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '
1283 git config --add -f .gitmodules submodule.subname.ignore all &&
1284 git config --add -f .gitmodules submodule.subname.path sm &&
1285 git status > output &&
1286 test_cmp expect output &&
1287 git config -f .gitmodules --remove-section submodule.subname
1290 test_expect_failure '.git/config ignore=all suppresses submodule summary' '
1291 git config --add -f .gitmodules submodule.subname.ignore none &&
1292 git config --add -f .gitmodules submodule.subname.path sm &&
1293 git config --add submodule.subname.ignore all &&
1294 git config --add submodule.subname.path sm &&
1295 git status > output &&
1296 test_cmp expect output &&
1297 git config --remove-section submodule.subname &&
1298 git config -f .gitmodules --remove-section submodule.subname