tests: don't set status.displayCommentPrefix file-wide
The previous commit set status.displayCommentPrefix file-wide in t7060-wtstatus.sh, t7508-status.sh and t/t7512-status-help.sh to make the patch small. However, now that status.displayCommentPrefix is not the default, it is better to disable it in tests so that the most common situation is also the most tested. While we're there, move the "cat > expect << EOF" blocks inside the tests. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy committed
Sep 6, 2013 at 19:43 UTC
1c7969c933c08a1a9d5b6fcd728ed95930b5b5ef
3 files changed
+793
-813
t/t7060-wtstatus.sh
+54
-59
@@ -4,10 +4,6 @@ test_description='basic work tree status reporting'
4
5
. ./test-lib.sh
6
7
-test_expect_success 'use status.displayCommentPrefix by default ' '
8
- git config --global status.displayCommentPrefix true
9
-'
10
-
7
test_expect_success setup '
8
git config --global advice.statusuoption false &&
9
test_commit A &&
@@ -33,20 +29,19 @@ test_expect_success 'Report new path with conflict' '
29
test_cmp expect actual
30
'
31
36
-cat >expect <<EOF
37
-# On branch side
38
-# You have unmerged paths.
39
-# (fix conflicts and run "git commit")
40
-#
41
-# Unmerged paths:
42
-# (use "git add/rm <file>..." as appropriate to mark resolution)
43
-#
44
-# deleted by us: foo
45
-#
32
+test_expect_success 'M/D conflict does not segfault' '
33
+ cat >expect <<EOF &&
34
+On branch side
35
+You have unmerged paths.
36
+ (fix conflicts and run "git commit")
37
+
38
+Unmerged paths:
39
+ (use "git add/rm <file>..." as appropriate to mark resolution)
40
+
41
+ deleted by us: foo
42
+
43
no changes added to commit (use "git add" and/or "git commit -a")
44
EOF
48
-
49
-test_expect_success 'M/D conflict does not segfault' '
45
mkdir mdconflict &&
46
(
47
cd mdconflict &&
@@ -139,19 +134,19 @@ test_expect_success 'status when conflicts with add and rm advice (deleted by th
134
test_commit on_second main.txt on_second &&
135
test_commit master conflict.txt master &&
136
test_must_fail git merge second_branch &&
142
- cat >expected <<-\EOF &&
143
- # On branch master
144
- # You have unmerged paths.
145
- # (fix conflicts and run "git commit")
146
- #
147
- # Unmerged paths:
148
- # (use "git add/rm <file>..." as appropriate to mark resolution)
149
- #
150
- # both added: conflict.txt
151
- # deleted by them: main.txt
152
- #
153
- no changes added to commit (use "git add" and/or "git commit -a")
154
- EOF
137
+ cat >expected <<\EOF &&
138
+On branch master
139
+You have unmerged paths.
140
+ (fix conflicts and run "git commit")
141
+
142
+Unmerged paths:
143
+ (use "git add/rm <file>..." as appropriate to mark resolution)
144
+
145
+ both added: conflict.txt
146
+ deleted by them: main.txt
147
+
148
+no changes added to commit (use "git add" and/or "git commit -a")
149
+EOF
150
git status --untracked-files=no >actual &&
151
test_i18ncmp expected actual
152
'
@@ -172,20 +167,20 @@ test_expect_success 'prepare for conflicts' '
167
168
test_expect_success 'status when conflicts with add and rm advice (both deleted)' '
169
test_must_fail git merge conflict &&
175
- cat >expected <<-\EOF &&
176
- # On branch conflict_second
177
- # You have unmerged paths.
178
- # (fix conflicts and run "git commit")
179
- #
180
- # Unmerged paths:
181
- # (use "git add/rm <file>..." as appropriate to mark resolution)
182
- #
183
- # both deleted: main.txt
184
- # added by them: sub_master.txt
185
- # added by us: sub_second.txt
186
- #
187
- no changes added to commit (use "git add" and/or "git commit -a")
188
- EOF
170
+ cat >expected <<\EOF &&
171
+On branch conflict_second
172
+You have unmerged paths.
173
+ (fix conflicts and run "git commit")
174
+
175
+Unmerged paths:
176
+ (use "git add/rm <file>..." as appropriate to mark resolution)
177
+
178
+ both deleted: main.txt
179
+ added by them: sub_master.txt
180
+ added by us: sub_second.txt
181
+
182
+no changes added to commit (use "git add" and/or "git commit -a")
183
+EOF
184
git status --untracked-files=no >actual &&
185
test_i18ncmp expected actual
186
'
@@ -196,22 +191,22 @@ test_expect_success 'status when conflicts with only rm advice (both deleted)' '
191
test_must_fail git merge conflict &&
192
git add sub_master.txt &&
193
git add sub_second.txt &&
199
- cat >expected <<-\EOF &&
200
- # On branch conflict_second
201
- # You have unmerged paths.
202
- # (fix conflicts and run "git commit")
203
- #
204
- # Changes to be committed:
205
- #
206
- # new file: sub_master.txt
207
- #
208
- # Unmerged paths:
209
- # (use "git rm <file>..." to mark resolution)
210
- #
211
- # both deleted: main.txt
212
- #
213
- # Untracked files not listed (use -u option to show untracked files)
214
- EOF
194
+ cat >expected <<\EOF &&
195
+On branch conflict_second
196
+You have unmerged paths.
197
+ (fix conflicts and run "git commit")
198
+
199
+Changes to be committed:
200
+
201
+ new file: sub_master.txt
202
+
203
+Unmerged paths:
204
+ (use "git rm <file>..." to mark resolution)
205
+
206
+ both deleted: main.txt
207
+
208
+Untracked files not listed (use -u option to show untracked files)
209
+EOF
210
git status --untracked-files=no >actual &&
211
test_i18ncmp expected actual &&
212
git reset --hard &&
t/t7508-status.sh
+439
-450
@@ -7,10 +7,6 @@ test_description='git status'
7
8
. ./test-lib.sh
9
10
-test_expect_success 'use status.displayCommentPrefix by default ' '
11
- git config --global status.displayCommentPrefix true
12
-'
13
-
10
test_expect_success 'status -h in broken repository' '
11
git config --global advice.statusuoption false &&
12
mkdir broken &&
@@ -157,20 +153,20 @@ test_expect_success 'commit ignores status.displayCommentPrefix=false in COMMIT_
153
'
154
155
cat >expect <<\EOF
160
-# On branch master
161
-# Changes to be committed:
162
-# new file: dir2/added
163
-#
164
-# Changes not staged for commit:
165
-# modified: dir1/modified
166
-#
167
-# Untracked files:
168
-# dir1/untracked
169
-# dir2/modified
170
-# dir2/untracked
171
-# expect
172
-# output
173
-# untracked
156
+On branch master
157
+Changes to be committed:
158
+ new file: dir2/added
159
+
160
+Changes not staged for commit:
161
+ modified: dir1/modified
162
+
163
+Untracked files:
164
+ dir1/untracked
165
+ dir2/modified
166
+ dir2/untracked
167
+ expect
168
+ output
169
+ untracked
170
EOF
171
172
test_expect_success 'status (advice.statusHints false)' '
@@ -228,33 +224,33 @@ test_expect_success 'status with gitignore' '
224
git status -s --ignored >output &&
225
test_cmp expect output &&
226
231
- cat >expect <<-\EOF &&
232
- # On branch master
233
- # Changes to be committed:
234
- # (use "git reset HEAD <file>..." to unstage)
235
- #
236
- # new file: dir2/added
237
- #
238
- # Changes not staged for commit:
239
- # (use "git add <file>..." to update what will be committed)
240
- # (use "git checkout -- <file>..." to discard changes in working directory)
241
- #
242
- # modified: dir1/modified
243
- #
244
- # Untracked files:
245
- # (use "git add <file>..." to include in what will be committed)
246
- #
247
- # dir2/modified
248
- # Ignored files:
249
- # (use "git add -f <file>..." to include in what will be committed)
250
- #
251
- # .gitignore
252
- # dir1/untracked
253
- # dir2/untracked
254
- # expect
255
- # output
256
- # untracked
257
- EOF
227
+ cat >expect <<\EOF &&
228
+On branch master
229
+Changes to be committed:
230
+ (use "git reset HEAD <file>..." to unstage)
231
+
232
+ new file: dir2/added
233
+
234
+Changes not staged for commit:
235
+ (use "git add <file>..." to update what will be committed)
236
+ (use "git checkout -- <file>..." to discard changes in working directory)
237
+
238
+ modified: dir1/modified
239
+
240
+Untracked files:
241
+ (use "git add <file>..." to include in what will be committed)
242
+
243
+ dir2/modified
244
+Ignored files:
245
+ (use "git add -f <file>..." to include in what will be committed)
246
+
247
+ .gitignore
248
+ dir1/untracked
249
+ dir2/untracked
250
+ expect
251
+ output
252
+ untracked
253
+EOF
254
git status --ignored >output &&
255
test_i18ncmp expect output
256
'
@@ -289,30 +285,30 @@ test_expect_success 'status with gitignore (nothing untracked)' '
285
git status -s --ignored >output &&
286
test_cmp expect output &&
287
292
- cat >expect <<-\EOF &&
293
- # On branch master
294
- # Changes to be committed:
295
- # (use "git reset HEAD <file>..." to unstage)
296
- #
297
- # new file: dir2/added
298
- #
299
- # Changes not staged for commit:
300
- # (use "git add <file>..." to update what will be committed)
301
- # (use "git checkout -- <file>..." to discard changes in working directory)
302
- #
303
- # modified: dir1/modified
304
- #
305
- # Ignored files:
306
- # (use "git add -f <file>..." to include in what will be committed)
307
- #
308
- # .gitignore
309
- # dir1/untracked
310
- # dir2/modified
311
- # dir2/untracked
312
- # expect
313
- # output
314
- # untracked
315
- EOF
288
+ cat >expect <<\EOF &&
289
+On branch master
290
+Changes to be committed:
291
+ (use "git reset HEAD <file>..." to unstage)
292
+
293
+ new file: dir2/added
294
+
295
+Changes not staged for commit:
296
+ (use "git add <file>..." to update what will be committed)
297
+ (use "git checkout -- <file>..." to discard changes in working directory)
298
+
299
+ modified: dir1/modified
300
+
301
+Ignored files:
302
+ (use "git add -f <file>..." to include in what will be committed)
303
+
304
+ .gitignore
305
+ dir1/untracked
306
+ dir2/modified
307
+ dir2/untracked
308
+ expect
309
+ output
310
+ untracked
311
+EOF
312
git status --ignored >output &&
313
test_i18ncmp expect output
314
'
@@ -353,22 +349,22 @@ test_expect_success 'setup dir3' '
349
: >dir3/untracked2
350
'
351
356
-cat >expect <<EOF
357
-# On branch master
358
-# Changes to be committed:
359
-# (use "git reset HEAD <file>..." to unstage)
360
-#
361
-# new file: dir2/added
362
-#
363
-# Changes not staged for commit:
364
-# (use "git add <file>..." to update what will be committed)
365
-# (use "git checkout -- <file>..." to discard changes in working directory)
366
-#
367
-# modified: dir1/modified
368
-#
369
-# Untracked files not listed (use -u option to show untracked files)
370
-EOF
352
test_expect_success 'status -uno' '
353
+ cat >expect <<EOF &&
354
+On branch master
355
+Changes to be committed:
356
+ (use "git reset HEAD <file>..." to unstage)
357
+
358
+ new file: dir2/added
359
+
360
+Changes not staged for commit:
361
+ (use "git add <file>..." to update what will be committed)
362
+ (use "git checkout -- <file>..." to discard changes in working directory)
363
+
364
+ modified: dir1/modified
365
+
366
+Untracked files not listed (use -u option to show untracked files)
367
+EOF
368
git status -uno >output &&
369
test_i18ncmp expect output
370
'
@@ -379,17 +375,17 @@ test_expect_success 'status (status.showUntrackedFiles no)' '
375
test_i18ncmp expect output
376
'
377
382
-cat >expect <<EOF
383
-# On branch master
384
-# Changes to be committed:
385
-# new file: dir2/added
386
-#
387
-# Changes not staged for commit:
388
-# modified: dir1/modified
389
-#
390
-# Untracked files not listed
391
-EOF
378
test_expect_success 'status -uno (advice.statusHints false)' '
379
+ cat >expect <<EOF &&
380
+On branch master
381
+Changes to be committed:
382
+ new file: dir2/added
383
+
384
+Changes not staged for commit:
385
+ modified: dir1/modified
386
+
387
+Untracked files not listed
388
+EOF
389
test_config advice.statusHints false &&
390
git status -uno >output &&
391
test_i18ncmp expect output
@@ -410,31 +406,31 @@ test_expect_success 'status -s (status.showUntrackedFiles no)' '
406
test_cmp expect output
407
'
408
413
-cat >expect <<EOF
414
-# On branch master
415
-# Changes to be committed:
416
-# (use "git reset HEAD <file>..." to unstage)
417
-#
418
-# new file: dir2/added
419
-#
420
-# Changes not staged for commit:
421
-# (use "git add <file>..." to update what will be committed)
422
-# (use "git checkout -- <file>..." to discard changes in working directory)
423
-#
424
-# modified: dir1/modified
425
-#
426
-# Untracked files:
427
-# (use "git add <file>..." to include in what will be committed)
428
-#
429
-# dir1/untracked
430
-# dir2/modified
431
-# dir2/untracked
432
-# dir3/
433
-# expect
434
-# output
435
-# untracked
436
-EOF
409
test_expect_success 'status -unormal' '
410
+ cat >expect <<EOF &&
411
+On branch master
412
+Changes to be committed:
413
+ (use "git reset HEAD <file>..." to unstage)
414
+
415
+ new file: dir2/added
416
+
417
+Changes not staged for commit:
418
+ (use "git add <file>..." to update what will be committed)
419
+ (use "git checkout -- <file>..." to discard changes in working directory)
420
+
421
+ modified: dir1/modified
422
+
423
+Untracked files:
424
+ (use "git add <file>..." to include in what will be committed)
425
+
426
+ dir1/untracked
427
+ dir2/modified
428
+ dir2/untracked
429
+ dir3/
430
+ expect
431
+ output
432
+ untracked
433
+EOF
434
git status -unormal >output &&
435
test_i18ncmp expect output
436
'
@@ -467,32 +463,32 @@ test_expect_success 'status -s (status.showUntrackedFiles normal)' '
463
test_cmp expect output
464
'
465
470
-cat >expect <<EOF
471
-# On branch master
472
-# Changes to be committed:
473
-# (use "git reset HEAD <file>..." to unstage)
474
-#
475
-# new file: dir2/added
476
-#
477
-# Changes not staged for commit:
478
-# (use "git add <file>..." to update what will be committed)
479
-# (use "git checkout -- <file>..." to discard changes in working directory)
480
-#
481
-# modified: dir1/modified
482
-#
483
-# Untracked files:
484
-# (use "git add <file>..." to include in what will be committed)
485
-#
486
-# dir1/untracked
487
-# dir2/modified
488
-# dir2/untracked
489
-# dir3/untracked1
490
-# dir3/untracked2
491
-# expect
492
-# output
493
-# untracked
494
-EOF
466
test_expect_success 'status -uall' '
467
+ cat >expect <<EOF &&
468
+On branch master
469
+Changes to be committed:
470
+ (use "git reset HEAD <file>..." to unstage)
471
+
472
+ new file: dir2/added
473
+
474
+Changes not staged for commit:
475
+ (use "git add <file>..." to update what will be committed)
476
+ (use "git checkout -- <file>..." to discard changes in working directory)
477
+
478
+ modified: dir1/modified
479
+
480
+Untracked files:
481
+ (use "git add <file>..." to include in what will be committed)
482
+
483
+ dir1/untracked
484
+ dir2/modified
485
+ dir2/untracked
486
+ dir3/untracked1
487
+ dir3/untracked2
488
+ expect
489
+ output
490
+ untracked
491
+EOF
492
git status -uall >output &&
493
test_i18ncmp expect output
494
'
@@ -529,31 +525,30 @@ test_expect_success 'status -s (status.showUntrackedFiles all)' '
525
test_cmp expect output
526
'
527
532
-cat >expect <<\EOF
533
-# On branch master
534
-# Changes to be committed:
535
-# (use "git reset HEAD <file>..." to unstage)
536
-#
537
-# new file: ../dir2/added
538
-#
539
-# Changes not staged for commit:
540
-# (use "git add <file>..." to update what will be committed)
541
-# (use "git checkout -- <file>..." to discard changes in working directory)
542
-#
543
-# modified: modified
544
-#
545
-# Untracked files:
546
-# (use "git add <file>..." to include in what will be committed)
547
-#
548
-# untracked
549
-# ../dir2/modified
550
-# ../dir2/untracked
551
-# ../expect
552
-# ../output
553
-# ../untracked
554
-EOF
555
-
528
test_expect_success 'status with relative paths' '
529
+ cat >expect <<\EOF &&
530
+On branch master
531
+Changes to be committed:
532
+ (use "git reset HEAD <file>..." to unstage)
533
+
534
+ new file: ../dir2/added
535
+
536
+Changes not staged for commit:
537
+ (use "git add <file>..." to update what will be committed)
538
+ (use "git checkout -- <file>..." to discard changes in working directory)
539
+
540
+ modified: modified
541
+
542
+Untracked files:
543
+ (use "git add <file>..." to include in what will be committed)
544
+
545
+ untracked
546
+ ../dir2/modified
547
+ ../dir2/untracked
548
+ ../expect
549
+ ../output
550
+ ../untracked
551
+EOF
552
(cd dir1 && git status) >output &&
553
test_i18ncmp expect output
554
'
@@ -600,31 +595,30 @@ test_expect_success 'setup unique colors' '
595
596
'
597
603
-cat >expect <<\EOF
604
-# On branch <GREEN>master<RESET>
605
-# Changes to be committed:
606
-# (use "git reset HEAD <file>..." to unstage)
607
-#
608
-# <GREEN>new file: dir2/added<RESET>
609
-#
610
-# Changes not staged for commit:
611
-# (use "git add <file>..." to update what will be committed)
612
-# (use "git checkout -- <file>..." to discard changes in working directory)
613
-#
614
-# <RED>modified: dir1/modified<RESET>
615
-#
616
-# Untracked files:
617
-# (use "git add <file>..." to include in what will be committed)
618
-#
619
-# <BLUE>dir1/untracked<RESET>
620
-# <BLUE>dir2/modified<RESET>
621
-# <BLUE>dir2/untracked<RESET>
622
-# <BLUE>expect<RESET>
623
-# <BLUE>output<RESET>
624
-# <BLUE>untracked<RESET>
625
-EOF
626
-
598
test_expect_success 'status with color.ui' '
599
+ cat >expect <<\EOF &&
600
+On branch <GREEN>master<RESET>
601
+Changes to be committed:
602
+ (use "git reset HEAD <file>..." to unstage)
603
+
604
+ <GREEN>new file: dir2/added<RESET>
605
+
606
+Changes not staged for commit:
607
+ (use "git add <file>..." to update what will be committed)
608
+ (use "git checkout -- <file>..." to discard changes in working directory)
609
+
610
+ <RED>modified: dir1/modified<RESET>
611
+
612
+Untracked files:
613
+ (use "git add <file>..." to include in what will be committed)
614
+
615
+ <BLUE>dir1/untracked<RESET>
616
+ <BLUE>dir2/modified<RESET>
617
+ <BLUE>dir2/untracked<RESET>
618
+ <BLUE>expect<RESET>
619
+ <BLUE>output<RESET>
620
+ <BLUE>untracked<RESET>
621
+EOF
622
test_config color.ui always &&
623
git status | test_decode_color >output &&
624
test_i18ncmp expect output
@@ -728,33 +722,32 @@ test_expect_success 'status --porcelain respects -b' '
722
723
'
724
731
-cat >expect <<\EOF
732
-# On branch master
733
-# Changes to be committed:
734
-# (use "git reset HEAD <file>..." to unstage)
735
-#
736
-# new file: dir2/added
737
-#
738
-# Changes not staged for commit:
739
-# (use "git add <file>..." to update what will be committed)
740
-# (use "git checkout -- <file>..." to discard changes in working directory)
741
-#
742
-# modified: dir1/modified
743
-#
744
-# Untracked files:
745
-# (use "git add <file>..." to include in what will be committed)
746
-#
747
-# dir1/untracked
748
-# dir2/modified
749
-# dir2/untracked
750
-# expect
751
-# output
752
-# untracked
753
-EOF
725
726
727
test_expect_success 'status without relative paths' '
728
+ cat >expect <<\EOF &&
729
+On branch master
730
+Changes to be committed:
731
+ (use "git reset HEAD <file>..." to unstage)
732
+
733
+ new file: dir2/added
734
+
735
+Changes not staged for commit:
736
+ (use "git add <file>..." to update what will be committed)
737
+ (use "git checkout -- <file>..." to discard changes in working directory)
738
739
+ modified: dir1/modified
740
+
741
+Untracked files:
742
+ (use "git add <file>..." to include in what will be committed)
743
+
744
+ dir1/untracked
745
+ dir2/modified
746
+ dir2/untracked
747
+ expect
748
+ output
749
+ untracked
750
+EOF
751
test_config status.relativePaths false &&
752
(cd dir1 && git status) >output &&
753
test_i18ncmp expect output
@@ -780,23 +773,23 @@ test_expect_success 'status -s without relative paths' '
773
774
'
775
783
-cat <<EOF >expect
784
-# On branch master
785
-# Changes to be committed:
786
-# (use "git reset HEAD <file>..." to unstage)
787
-#
788
-# modified: dir1/modified
789
-#
790
-# Untracked files:
791
-# (use "git add <file>..." to include in what will be committed)
792
-#
793
-# dir1/untracked
794
-# dir2/
795
-# expect
796
-# output
797
-# untracked
798
-EOF
776
test_expect_success 'dry-run of partial commit excluding new file in index' '
777
+ cat >expect <<EOF &&
778
+On branch master
779
+Changes to be committed:
780
+ (use "git reset HEAD <file>..." to unstage)
781
+
782
+ modified: dir1/modified
783
+
784
+Untracked files:
785
+ (use "git add <file>..." to include in what will be committed)
786
+
787
+ dir1/untracked
788
+ dir2/
789
+ expect
790
+ output
791
+ untracked
792
+EOF
793
git commit --dry-run dir1/modified >output &&
794
test_i18ncmp expect output
795
'
@@ -821,31 +814,31 @@ test_expect_success 'setup status submodule summary' '
814
git add sm
815
'
816
824
-cat >expect <<EOF
825
-# On branch master
826
-# Changes to be committed:
827
-# (use "git reset HEAD <file>..." to unstage)
828
-#
829
-# new file: dir2/added
830
-# new file: sm
831
-#
832
-# Changes not staged for commit:
833
-# (use "git add <file>..." to update what will be committed)
834
-# (use "git checkout -- <file>..." to discard changes in working directory)
835
-#
836
-# modified: dir1/modified
837
-#
838
-# Untracked files:
839
-# (use "git add <file>..." to include in what will be committed)
840
-#
841
-# dir1/untracked
842
-# dir2/modified
843
-# dir2/untracked
844
-# expect
845
-# output
846
-# untracked
847
-EOF
817
test_expect_success 'status submodule summary is disabled by default' '
818
+ cat >expect <<EOF &&
819
+On branch master
820
+Changes to be committed:
821
+ (use "git reset HEAD <file>..." to unstage)
822
+
823
+ new file: dir2/added
824
+ new file: sm
825
+
826
+Changes not staged for commit:
827
+ (use "git add <file>..." to update what will be committed)
828
+ (use "git checkout -- <file>..." to discard changes in working directory)
829
+
830
+ modified: dir1/modified
831
+
832
+Untracked files:
833
+ (use "git add <file>..." to include in what will be committed)
834
+
835
+ dir1/untracked
836
+ dir2/modified
837
+ dir2/untracked
838
+ expect
839
+ output
840
+ untracked
841
+EOF
842
git status >output &&
843
test_i18ncmp expect output
844
'
@@ -880,36 +873,36 @@ test_expect_success 'status -s --untracked-files=all does not show submodule' '
873
874
head=$(cd sm && git rev-parse --short=7 --verify HEAD)
875
883
-cat >expect <<EOF
884
-# On branch master
885
-# Changes to be committed:
886
-# (use "git reset HEAD <file>..." to unstage)
887
-#
888
-# new file: dir2/added
889
-# new file: sm
890
-#
891
-# Changes not staged for commit:
892
-# (use "git add <file>..." to update what will be committed)
893
-# (use "git checkout -- <file>..." to discard changes in working directory)
894
-#
895
-# modified: dir1/modified
896
-#
897
-# Submodule changes to be committed:
898
-#
899
-# * sm 0000000...$head (1):
900
-# > Add foo
901
-#
902
-# Untracked files:
903
-# (use "git add <file>..." to include in what will be committed)
904
-#
905
-# dir1/untracked
906
-# dir2/modified
907
-# dir2/untracked
908
-# expect
909
-# output
910
-# untracked
911
-EOF
876
test_expect_success 'status submodule summary' '
877
+ cat >expect <<EOF &&
878
+On branch master
879
+Changes to be committed:
880
+ (use "git reset HEAD <file>..." to unstage)
881
+
882
+ new file: dir2/added
883
+ new file: sm
884
+
885
+Changes not staged for commit:
886
+ (use "git add <file>..." to update what will be committed)
887
+ (use "git checkout -- <file>..." to discard changes in working directory)
888
+
889
+ modified: dir1/modified
890
+
891
+Submodule changes to be committed:
892
+
893
+* sm 0000000...$head (1):
894
+ > Add foo
895
+
896
+Untracked files:
897
+ (use "git add <file>..." to include in what will be committed)
898
+
899
+ dir1/untracked
900
+ dir2/modified
901
+ dir2/untracked
902
+ expect
903
+ output
904
+ untracked
905
+EOF
906
git config status.submodulesummary 10 &&
907
git status >output &&
908
test_i18ncmp expect output
@@ -941,26 +934,26 @@ test_expect_success 'status -s submodule summary' '
934
test_cmp expect output
935
'
936
944
-cat >expect <<EOF
945
-# On branch master
946
-# Changes not staged for commit:
947
-# (use "git add <file>..." to update what will be committed)
948
-# (use "git checkout -- <file>..." to discard changes in working directory)
949
-#
950
-# modified: dir1/modified
951
-#
952
-# Untracked files:
953
-# (use "git add <file>..." to include in what will be committed)
954
-#
955
-# dir1/untracked
956
-# dir2/modified
957
-# dir2/untracked
958
-# expect
959
-# output
960
-# untracked
937
+test_expect_success 'status submodule summary (clean submodule): commit' '
938
+ cat >expect <<EOF &&
939
+On branch master
940
+Changes not staged for commit:
941
+ (use "git add <file>..." to update what will be committed)
942
+ (use "git checkout -- <file>..." to discard changes in working directory)
943
+
944
+ modified: dir1/modified
945
+
946
+Untracked files:
947
+ (use "git add <file>..." to include in what will be committed)
948
+
949
+ dir1/untracked
950
+ dir2/modified
951
+ dir2/untracked
952
+ expect
953
+ output
954
+ untracked
955
no changes added to commit (use "git add" and/or "git commit -a")
956
EOF
963
-test_expect_success 'status submodule summary (clean submodule): commit' '
957
git commit -m "commit submodule" &&
958
git config status.submodulesummary 10 &&
959
test_must_fail git commit --dry-run >output &&
@@ -990,36 +983,36 @@ test_expect_success 'status -z implies porcelain' '
983
test_cmp expect output
984
'
985
993
-cat >expect <<EOF
994
-# On branch master
995
-# Changes to be committed:
996
-# (use "git reset HEAD^1 <file>..." to unstage)
997
-#
998
-# new file: dir2/added
999
-# new file: sm
1000
-#
1001
-# Changes not staged for commit:
1002
-# (use "git add <file>..." to update what will be committed)
1003
-# (use "git checkout -- <file>..." to discard changes in working directory)
1004
-#
1005
-# modified: dir1/modified
1006
-#
1007
-# Submodule changes to be committed:
1008
-#
1009
-# * sm 0000000...$head (1):
1010
-# > Add foo
1011
-#
1012
-# Untracked files:
1013
-# (use "git add <file>..." to include in what will be committed)
1014
-#
1015
-# dir1/untracked
1016
-# dir2/modified
1017
-# dir2/untracked
1018
-# expect
1019
-# output
1020
-# untracked
1021
-EOF
986
test_expect_success 'commit --dry-run submodule summary (--amend)' '
987
+ cat >expect <<EOF &&
988
+On branch master
989
+Changes to be committed:
990
+ (use "git reset HEAD^1 <file>..." to unstage)
991
+
992
+ new file: dir2/added
993
+ new file: sm
994
+
995
+Changes not staged for commit:
996
+ (use "git add <file>..." to update what will be committed)
997
+ (use "git checkout -- <file>..." to discard changes in working directory)
998
+
999
+ modified: dir1/modified
1000
+
1001
+Submodule changes to be committed:
1002
+
1003
+* sm 0000000...$head (1):
1004
+ > Add foo
1005
+
1006
+Untracked files:
1007
+ (use "git add <file>..." to include in what will be committed)
1008
+
1009
+ dir1/untracked
1010
+ dir2/modified
1011
+ dir2/untracked
1012
+ expect
1013
+ output
1014
+ untracked
1015
+EOF
1016
git config status.submodulesummary 10 &&
1017
git commit --dry-run --amend >output &&
1018
test_i18ncmp expect output
@@ -1044,37 +1037,36 @@ test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository'
1037
new_head=$(cd sm && git rev-parse --short=7 --verify HEAD)
1038
touch .gitmodules
1039
1047
-cat > expect << EOF
1048
-# On branch master
1049
-# Changes to be committed:
1050
-# (use "git reset HEAD <file>..." to unstage)
1051
-#
1052
-# modified: sm
1053
-#
1054
-# Changes not staged for commit:
1055
-# (use "git add <file>..." to update what will be committed)
1056
-# (use "git checkout -- <file>..." to discard changes in working directory)
1057
-#
1058
-# modified: dir1/modified
1059
-#
1060
-# Submodule changes to be committed:
1061
-#
1062
-# * sm $head...$new_head (1):
1063
-# > Add bar
1064
-#
1065
-# Untracked files:
1066
-# (use "git add <file>..." to include in what will be committed)
1067
-#
1068
-# .gitmodules
1069
-# dir1/untracked
1070
-# dir2/modified
1071
-# dir2/untracked
1072
-# expect
1073
-# output
1074
-# untracked
1075
-EOF
1076
-
1040
test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
1041
+ cat > expect << EOF &&
1042
+On branch master
1043
+Changes to be committed:
1044
+ (use "git reset HEAD <file>..." to unstage)
1045
+
1046
+ modified: sm
1047
+
1048
+Changes not staged for commit:
1049
+ (use "git add <file>..." to update what will be committed)
1050
+ (use "git checkout -- <file>..." to discard changes in working directory)
1051
+
1052
+ modified: dir1/modified
1053
+
1054
+Submodule changes to be committed:
1055
+
1056
+* sm $head...$new_head (1):
1057
+ > Add bar
1058
+
1059
+Untracked files:
1060
+ (use "git add <file>..." to include in what will be committed)
1061
+
1062
+ .gitmodules
1063
+ dir1/untracked
1064
+ dir2/modified
1065
+ dir2/untracked
1066
+ expect
1067
+ output
1068
+ untracked
1069
+EOF
1070
echo modified sm/untracked &&
1071
git status --ignore-submodules=untracked >output &&
1072
test_i18ncmp expect output
@@ -1154,39 +1146,38 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with modifie
1146
git config -f .gitmodules --remove-section submodule.subname
1147
'
1148
1157
-cat > expect << EOF
1158
-# On branch master
1159
-# Changes to be committed:
1160
-# (use "git reset HEAD <file>..." to unstage)
1161
-#
1162
-# modified: sm
1163
-#
1164
-# Changes not staged for commit:
1165
-# (use "git add <file>..." to update what will be committed)
1166
-# (use "git checkout -- <file>..." to discard changes in working directory)
1167
-# (commit or discard the untracked or modified content in submodules)
1168
-#
1169
-# modified: dir1/modified
1170
-# modified: sm (modified content)
1171
-#
1172
-# Submodule changes to be committed:
1173
-#
1174
-# * sm $head...$new_head (1):
1175
-# > Add bar
1176
-#
1177
-# Untracked files:
1178
-# (use "git add <file>..." to include in what will be committed)
1179
-#
1180
-# .gitmodules
1181
-# dir1/untracked
1182
-# dir2/modified
1183
-# dir2/untracked
1184
-# expect
1185
-# output
1186
-# untracked
1187
-EOF
1188
-
1149
test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
1150
+ cat > expect << EOF &&
1151
+On branch master
1152
+Changes to be committed:
1153
+ (use "git reset HEAD <file>..." to unstage)
1154
+
1155
+ modified: sm
1156
+
1157
+Changes not staged for commit:
1158
+ (use "git add <file>..." to update what will be committed)
1159
+ (use "git checkout -- <file>..." to discard changes in working directory)
1160
+ (commit or discard the untracked or modified content in submodules)
1161
+
1162
+ modified: dir1/modified
1163
+ modified: sm (modified content)
1164
+
1165
+Submodule changes to be committed:
1166
+
1167
+* sm $head...$new_head (1):
1168
+ > Add bar
1169
+
1170
+Untracked files:
1171
+ (use "git add <file>..." to include in what will be committed)
1172
+
1173
+ .gitmodules
1174
+ dir1/untracked
1175
+ dir2/modified
1176
+ dir2/untracked
1177
+ expect
1178
+ output
1179
+ untracked
1180
+EOF
1181
git status --ignore-submodules=untracked > output &&
1182
test_i18ncmp expect output
1183
'
@@ -1212,43 +1203,42 @@ test_expect_success ".git/config ignore=untracked doesn't suppress submodules wi
1203
1204
head2=$(cd sm && git commit -q -m "2nd commit" foo && git rev-parse --short=7 --verify HEAD)
1205
1215
-cat > expect << EOF
1216
-# On branch master
1217
-# Changes to be committed:
1218
-# (use "git reset HEAD <file>..." to unstage)
1219
-#
1220
-# modified: sm
1221
-#
1222
-# Changes not staged for commit:
1223
-# (use "git add <file>..." to update what will be committed)
1224
-# (use "git checkout -- <file>..." to discard changes in working directory)
1225
-#
1226
-# modified: dir1/modified
1227
-# modified: sm (new commits)
1228
-#
1229
-# Submodule changes to be committed:
1230
-#
1231
-# * sm $head...$new_head (1):
1232
-# > Add bar
1233
-#
1234
-# Submodules changed but not updated:
1235
-#
1236
-# * sm $new_head...$head2 (1):
1237
-# > 2nd commit
1238
-#
1239
-# Untracked files:
1240
-# (use "git add <file>..." to include in what will be committed)
1241
-#
1242
-# .gitmodules
1243
-# dir1/untracked
1244
-# dir2/modified
1245
-# dir2/untracked
1246
-# expect
1247
-# output
1248
-# untracked
1249
-EOF
1250
-
1206
test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
1207
+ cat > expect << EOF &&
1208
+On branch master
1209
+Changes to be committed:
1210
+ (use "git reset HEAD <file>..." to unstage)
1211
+
1212
+ modified: sm
1213
+
1214
+Changes not staged for commit:
1215
+ (use "git add <file>..." to update what will be committed)
1216
+ (use "git checkout -- <file>..." to discard changes in working directory)
1217
+
1218
+ modified: dir1/modified
1219
+ modified: sm (new commits)
1220
+
1221
+Submodule changes to be committed:
1222
+
1223
+* sm $head...$new_head (1):
1224
+ > Add bar
1225
+
1226
+Submodules changed but not updated:
1227
+
1228
+* sm $new_head...$head2 (1):
1229
+ > 2nd commit
1230
+
1231
+Untracked files:
1232
+ (use "git add <file>..." to include in what will be committed)
1233
+
1234
+ .gitmodules
1235
+ dir1/untracked
1236
+ dir2/modified
1237
+ dir2/untracked
1238
+ expect
1239
+ output
1240
+ untracked
1241
+EOF
1242
git status --ignore-submodules=untracked > output &&
1243
test_i18ncmp expect output
1244
'
@@ -1333,38 +1323,37 @@ EOF
1323
1324
test_expect_success "status (core.commentchar with submodule summary)" '
1325
test_config core.commentchar ";" &&
1336
- git status >output &&
1326
+ git -c status.displayCommentPrefix=true status >output &&
1327
test_i18ncmp expect output
1328
'
1329
1330
test_expect_success "status (core.commentchar with two chars with submodule summary)" '
1331
test_config core.commentchar ";;" &&
1342
- git status >output &&
1332
+ git -c status.displayCommentPrefix=true status >output &&
1333
test_i18ncmp expect output
1334
'
1335
1346
-cat > expect << EOF
1347
-# On branch master
1348
-# Changes not staged for commit:
1349
-# (use "git add <file>..." to update what will be committed)
1350
-# (use "git checkout -- <file>..." to discard changes in working directory)
1351
-#
1352
-# modified: dir1/modified
1353
-#
1354
-# Untracked files:
1355
-# (use "git add <file>..." to include in what will be committed)
1356
-#
1357
-# .gitmodules
1358
-# dir1/untracked
1359
-# dir2/modified
1360
-# dir2/untracked
1361
-# expect
1362
-# output
1363
-# untracked
1336
+test_expect_success "--ignore-submodules=all suppresses submodule summary" '
1337
+ cat > expect << EOF &&
1338
+On branch master
1339
+Changes not staged for commit:
1340
+ (use "git add <file>..." to update what will be committed)
1341
+ (use "git checkout -- <file>..." to discard changes in working directory)
1342
+
1343
+ modified: dir1/modified
1344
+
1345
+Untracked files:
1346
+ (use "git add <file>..." to include in what will be committed)
1347
+
1348
+ .gitmodules
1349
+ dir1/untracked
1350
+ dir2/modified
1351
+ dir2/untracked
1352
+ expect
1353
+ output
1354
+ untracked
1355
no changes added to commit (use "git add" and/or "git commit -a")
1356
EOF
1366
-
1367
-test_expect_success "--ignore-submodules=all suppresses submodule summary" '
1357
git status --ignore-submodules=all > output &&
1358
test_i18ncmp expect output
1359
'
t/t7512-status-help.sh
+300
-304
@@ -13,10 +13,6 @@ test_description='git status advice'
13
14
set_fake_editor
15
16
-test_expect_success 'use status.displayCommentPrefix by default ' '
17
- git config --global status.displayCommentPrefix true
18
-'
19
-
16
test_expect_success 'prepare for conflicts' '
17
git config --global advice.statusuoption false &&
18
test_commit init main.txt init &&
@@ -29,18 +25,18 @@ test_expect_success 'prepare for conflicts' '
25
26
test_expect_success 'status when conflicts unresolved' '
27
test_must_fail git merge master &&
32
- cat >expected <<-\EOF &&
33
- # On branch conflicts
34
- # You have unmerged paths.
35
- # (fix conflicts and run "git commit")
36
- #
37
- # Unmerged paths:
38
- # (use "git add <file>..." to mark resolution)
39
- #
40
- # both modified: main.txt
41
- #
42
- no changes added to commit (use "git add" and/or "git commit -a")
43
- EOF
28
+ cat >expected <<\EOF &&
29
+On branch conflicts
30
+You have unmerged paths.
31
+ (fix conflicts and run "git commit")
32
+
33
+Unmerged paths:
34
+ (use "git add <file>..." to mark resolution)
35
+
36
+ both modified: main.txt
37
+
38
+no changes added to commit (use "git add" and/or "git commit -a")
39
+EOF
40
git status --untracked-files=no >actual &&
41
test_i18ncmp expected actual
42
'
@@ -51,17 +47,17 @@ test_expect_success 'status when conflicts resolved before commit' '
47
test_must_fail git merge master &&
48
echo one >main.txt &&
49
git add main.txt &&
54
- cat >expected <<-\EOF &&
55
- # On branch conflicts
56
- # All conflicts fixed but you are still merging.
57
- # (use "git commit" to conclude merge)
58
- #
59
- # Changes to be committed:
60
- #
61
- # modified: main.txt
62
- #
63
- # Untracked files not listed (use -u option to show untracked files)
64
- EOF
50
+ cat >expected <<\EOF &&
51
+On branch conflicts
52
+All conflicts fixed but you are still merging.
53
+ (use "git commit" to conclude merge)
54
+
55
+Changes to be committed:
56
+
57
+ modified: main.txt
58
+
59
+Untracked files not listed (use -u option to show untracked files)
60
+EOF
61
git status --untracked-files=no >actual &&
62
test_i18ncmp expected actual
63
'
@@ -80,21 +76,21 @@ test_expect_success 'status when rebase in progress before resolving conflicts'
76
test_when_finished "git rebase --abort" &&
77
ONTO=$(git rev-parse --short HEAD^^) &&
78
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
83
- cat >expected <<-EOF &&
84
- # rebase in progress; onto $ONTO
85
- # You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
86
- # (fix conflicts and then run "git rebase --continue")
87
- # (use "git rebase --skip" to skip this patch)
88
- # (use "git rebase --abort" to check out the original branch)
89
- #
90
- # Unmerged paths:
91
- # (use "git reset HEAD <file>..." to unstage)
92
- # (use "git add <file>..." to mark resolution)
93
- #
94
- # both modified: main.txt
95
- #
96
- no changes added to commit (use "git add" and/or "git commit -a")
97
- EOF
79
+ cat >expected <<EOF &&
80
+rebase in progress; onto $ONTO
81
+You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
82
+ (fix conflicts and then run "git rebase --continue")
83
+ (use "git rebase --skip" to skip this patch)
84
+ (use "git rebase --abort" to check out the original branch)
85
+
86
+Unmerged paths:
87
+ (use "git reset HEAD <file>..." to unstage)
88
+ (use "git add <file>..." to mark resolution)
89
+
90
+ both modified: main.txt
91
+
92
+no changes added to commit (use "git add" and/or "git commit -a")
93
+EOF
94
git status --untracked-files=no >actual &&
95
test_i18ncmp expected actual
96
'
@@ -107,18 +103,18 @@ test_expect_success 'status when rebase in progress before rebase --continue' '
103
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
104
echo three >main.txt &&
105
git add main.txt &&
110
- cat >expected <<-EOF &&
111
- # rebase in progress; onto $ONTO
112
- # You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
113
- # (all conflicts fixed: run "git rebase --continue")
114
- #
115
- # Changes to be committed:
116
- # (use "git reset HEAD <file>..." to unstage)
117
- #
118
- # modified: main.txt
119
- #
120
- # Untracked files not listed (use -u option to show untracked files)
121
- EOF
106
+ cat >expected <<EOF &&
107
+rebase in progress; onto $ONTO
108
+You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
109
+ (all conflicts fixed: run "git rebase --continue")
110
+
111
+Changes to be committed:
112
+ (use "git reset HEAD <file>..." to unstage)
113
+
114
+ modified: main.txt
115
+
116
+Untracked files not listed (use -u option to show untracked files)
117
+EOF
118
git status --untracked-files=no >actual &&
119
test_i18ncmp expected actual
120
'
@@ -139,21 +135,21 @@ test_expect_success 'status during rebase -i when conflicts unresolved' '
135
test_when_finished "git rebase --abort" &&
136
ONTO=$(git rev-parse --short rebase_i_conflicts) &&
137
test_must_fail git rebase -i rebase_i_conflicts &&
142
- cat >expected <<-EOF &&
143
- # rebase in progress; onto $ONTO
144
- # You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
145
- # (fix conflicts and then run "git rebase --continue")
146
- # (use "git rebase --skip" to skip this patch)
147
- # (use "git rebase --abort" to check out the original branch)
148
- #
149
- # Unmerged paths:
150
- # (use "git reset HEAD <file>..." to unstage)
151
- # (use "git add <file>..." to mark resolution)
152
- #
153
- # both modified: main.txt
154
- #
155
- no changes added to commit (use "git add" and/or "git commit -a")
156
- EOF
138
+ cat >expected <<EOF &&
139
+rebase in progress; onto $ONTO
140
+You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
141
+ (fix conflicts and then run "git rebase --continue")
142
+ (use "git rebase --skip" to skip this patch)
143
+ (use "git rebase --abort" to check out the original branch)
144
+
145
+Unmerged paths:
146
+ (use "git reset HEAD <file>..." to unstage)
147
+ (use "git add <file>..." to mark resolution)
148
+
149
+ both modified: main.txt
150
+
151
+no changes added to commit (use "git add" and/or "git commit -a")
152
+EOF
153
git status --untracked-files=no >actual &&
154
test_i18ncmp expected actual
155
'
@@ -165,18 +161,18 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
161
ONTO=$(git rev-parse --short rebase_i_conflicts) &&
162
test_must_fail git rebase -i rebase_i_conflicts &&
163
git add main.txt &&
168
- cat >expected <<-EOF &&
169
- # rebase in progress; onto $ONTO
170
- # You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
171
- # (all conflicts fixed: run "git rebase --continue")
172
- #
173
- # Changes to be committed:
174
- # (use "git reset HEAD <file>..." to unstage)
175
- #
176
- # modified: main.txt
177
- #
178
- # Untracked files not listed (use -u option to show untracked files)
179
- EOF
164
+ cat >expected <<EOF &&
165
+rebase in progress; onto $ONTO
166
+You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
167
+ (all conflicts fixed: run "git rebase --continue")
168
+
169
+Changes to be committed:
170
+ (use "git reset HEAD <file>..." to unstage)
171
+
172
+ modified: main.txt
173
+
174
+Untracked files not listed (use -u option to show untracked files)
175
+EOF
176
git status --untracked-files=no >actual &&
177
test_i18ncmp expected actual
178
'
@@ -193,14 +189,14 @@ test_expect_success 'status when rebasing -i in edit mode' '
189
test_when_finished "git rebase --abort" &&
190
ONTO=$(git rev-parse --short HEAD~2) &&
191
git rebase -i HEAD~2 &&
196
- cat >expected <<-EOF &&
197
- # rebase in progress; onto $ONTO
198
- # You are currently editing a commit while rebasing branch '\''rebase_i_edit'\'' on '\''$ONTO'\''.
199
- # (use "git commit --amend" to amend the current commit)
200
- # (use "git rebase --continue" once you are satisfied with your changes)
201
- #
202
- nothing to commit (use -u to show untracked files)
203
- EOF
192
+ cat >expected <<EOF &&
193
+rebase in progress; onto $ONTO
194
+You are currently editing a commit while rebasing branch '\''rebase_i_edit'\'' on '\''$ONTO'\''.
195
+ (use "git commit --amend" to amend the current commit)
196
+ (use "git rebase --continue" once you are satisfied with your changes)
197
+
198
+nothing to commit (use -u to show untracked files)
199
+EOF
200
git status --untracked-files=no >actual &&
201
test_i18ncmp expected actual
202
'
@@ -219,19 +215,19 @@ test_expect_success 'status when splitting a commit' '
215
ONTO=$(git rev-parse --short HEAD~3) &&
216
git rebase -i HEAD~3 &&
217
git reset HEAD^ &&
222
- cat >expected <<-EOF &&
223
- # rebase in progress; onto $ONTO
224
- # You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
225
- # (Once your working directory is clean, run "git rebase --continue")
226
- #
227
- # Changes not staged for commit:
228
- # (use "git add <file>..." to update what will be committed)
229
- # (use "git checkout -- <file>..." to discard changes in working directory)
230
- #
231
- # modified: main.txt
232
- #
233
- no changes added to commit (use "git add" and/or "git commit -a")
234
- EOF
218
+ cat >expected <<EOF &&
219
+rebase in progress; onto $ONTO
220
+You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
221
+ (Once your working directory is clean, run "git rebase --continue")
222
+
223
+Changes not staged for commit:
224
+ (use "git add <file>..." to update what will be committed)
225
+ (use "git checkout -- <file>..." to discard changes in working directory)
226
+
227
+ modified: main.txt
228
+
229
+no changes added to commit (use "git add" and/or "git commit -a")
230
+EOF
231
git status --untracked-files=no >actual &&
232
test_i18ncmp expected actual
233
'
@@ -250,14 +246,14 @@ test_expect_success 'status after editing the last commit with --amend during a
246
ONTO=$(git rev-parse --short HEAD~3) &&
247
git rebase -i HEAD~3 &&
248
git commit --amend -m "foo" &&
253
- cat >expected <<-EOF &&
254
- # rebase in progress; onto $ONTO
255
- # You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
256
- # (use "git commit --amend" to amend the current commit)
257
- # (use "git rebase --continue" once you are satisfied with your changes)
258
- #
259
- nothing to commit (use -u to show untracked files)
260
- EOF
249
+ cat >expected <<EOF &&
250
+rebase in progress; onto $ONTO
251
+You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
252
+ (use "git commit --amend" to amend the current commit)
253
+ (use "git rebase --continue" once you are satisfied with your changes)
254
+
255
+nothing to commit (use -u to show untracked files)
256
+EOF
257
git status --untracked-files=no >actual &&
258
test_i18ncmp expected actual
259
'
@@ -280,14 +276,14 @@ test_expect_success 'status: (continue first edit) second edit' '
276
ONTO=$(git rev-parse --short HEAD~3) &&
277
git rebase -i HEAD~3 &&
278
git rebase --continue &&
283
- cat >expected <<-EOF &&
284
- # rebase in progress; onto $ONTO
285
- # You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
286
- # (use "git commit --amend" to amend the current commit)
287
- # (use "git rebase --continue" once you are satisfied with your changes)
288
- #
289
- nothing to commit (use -u to show untracked files)
290
- EOF
279
+ cat >expected <<EOF &&
280
+rebase in progress; onto $ONTO
281
+You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
282
+ (use "git commit --amend" to amend the current commit)
283
+ (use "git rebase --continue" once you are satisfied with your changes)
284
+
285
+nothing to commit (use -u to show untracked files)
286
+EOF
287
git status --untracked-files=no >actual &&
288
test_i18ncmp expected actual
289
'
@@ -302,19 +298,19 @@ test_expect_success 'status: (continue first edit) second edit and split' '
298
git rebase -i HEAD~3 &&
299
git rebase --continue &&
300
git reset HEAD^ &&
305
- cat >expected <<-EOF &&
306
- # rebase in progress; onto $ONTO
307
- # You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
308
- # (Once your working directory is clean, run "git rebase --continue")
309
- #
310
- # Changes not staged for commit:
311
- # (use "git add <file>..." to update what will be committed)
312
- # (use "git checkout -- <file>..." to discard changes in working directory)
313
- #
314
- # modified: main.txt
315
- #
316
- no changes added to commit (use "git add" and/or "git commit -a")
317
- EOF
301
+ cat >expected <<EOF &&
302
+rebase in progress; onto $ONTO
303
+You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
304
+ (Once your working directory is clean, run "git rebase --continue")
305
+
306
+Changes not staged for commit:
307
+ (use "git add <file>..." to update what will be committed)
308
+ (use "git checkout -- <file>..." to discard changes in working directory)
309
+
310
+ modified: main.txt
311
+
312
+no changes added to commit (use "git add" and/or "git commit -a")
313
+EOF
314
git status --untracked-files=no >actual &&
315
test_i18ncmp expected actual
316
'
@@ -329,14 +325,14 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
325
git rebase -i HEAD~3 &&
326
git rebase --continue &&
327
git commit --amend -m "foo" &&
332
- cat >expected <<-EOF &&
333
- # rebase in progress; onto $ONTO
334
- # You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
335
- # (use "git commit --amend" to amend the current commit)
336
- # (use "git rebase --continue" once you are satisfied with your changes)
337
- #
338
- nothing to commit (use -u to show untracked files)
339
- EOF
328
+ cat >expected <<EOF &&
329
+rebase in progress; onto $ONTO
330
+You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
331
+ (use "git commit --amend" to amend the current commit)
332
+ (use "git rebase --continue" once you are satisfied with your changes)
333
+
334
+nothing to commit (use -u to show untracked files)
335
+EOF
336
git status --untracked-files=no >actual &&
337
test_i18ncmp expected actual
338
'
@@ -351,14 +347,14 @@ test_expect_success 'status: (amend first edit) second edit' '
347
git rebase -i HEAD~3 &&
348
git commit --amend -m "a" &&
349
git rebase --continue &&
354
- cat >expected <<-EOF &&
355
- # rebase in progress; onto $ONTO
356
- # You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
357
- # (use "git commit --amend" to amend the current commit)
358
- # (use "git rebase --continue" once you are satisfied with your changes)
359
- #
360
- nothing to commit (use -u to show untracked files)
361
- EOF
350
+ cat >expected <<EOF &&
351
+rebase in progress; onto $ONTO
352
+You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
353
+ (use "git commit --amend" to amend the current commit)
354
+ (use "git rebase --continue" once you are satisfied with your changes)
355
+
356
+nothing to commit (use -u to show untracked files)
357
+EOF
358
git status --untracked-files=no >actual &&
359
test_i18ncmp expected actual
360
'
@@ -374,19 +370,19 @@ test_expect_success 'status: (amend first edit) second edit and split' '
370
git commit --amend -m "b" &&
371
git rebase --continue &&
372
git reset HEAD^ &&
377
- cat >expected <<-EOF &&
378
- # rebase in progress; onto $ONTO
379
- # You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
380
- # (Once your working directory is clean, run "git rebase --continue")
381
- #
382
- # Changes not staged for commit:
383
- # (use "git add <file>..." to update what will be committed)
384
- # (use "git checkout -- <file>..." to discard changes in working directory)
385
- #
386
- # modified: main.txt
387
- #
388
- no changes added to commit (use "git add" and/or "git commit -a")
389
- EOF
373
+ cat >expected <<EOF &&
374
+rebase in progress; onto $ONTO
375
+You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
376
+ (Once your working directory is clean, run "git rebase --continue")
377
+
378
+Changes not staged for commit:
379
+ (use "git add <file>..." to update what will be committed)
380
+ (use "git checkout -- <file>..." to discard changes in working directory)
381
+
382
+ modified: main.txt
383
+
384
+no changes added to commit (use "git add" and/or "git commit -a")
385
+EOF
386
git status --untracked-files=no >actual &&
387
test_i18ncmp expected actual
388
'
@@ -402,14 +398,14 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
398
git commit --amend -m "c" &&
399
git rebase --continue &&
400
git commit --amend -m "d" &&
405
- cat >expected <<-EOF &&
406
- # rebase in progress; onto $ONTO
407
- # You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
408
- # (use "git commit --amend" to amend the current commit)
409
- # (use "git rebase --continue" once you are satisfied with your changes)
410
- #
411
- nothing to commit (use -u to show untracked files)
412
- EOF
401
+ cat >expected <<EOF &&
402
+rebase in progress; onto $ONTO
403
+You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
404
+ (use "git commit --amend" to amend the current commit)
405
+ (use "git rebase --continue" once you are satisfied with your changes)
406
+
407
+nothing to commit (use -u to show untracked files)
408
+EOF
409
git status --untracked-files=no >actual &&
410
test_i18ncmp expected actual
411
'
@@ -426,14 +422,14 @@ test_expect_success 'status: (split first edit) second edit' '
422
git add main.txt &&
423
git commit -m "e" &&
424
git rebase --continue &&
429
- cat >expected <<-EOF &&
430
- # rebase in progress; onto $ONTO
431
- # You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
432
- # (use "git commit --amend" to amend the current commit)
433
- # (use "git rebase --continue" once you are satisfied with your changes)
434
- #
435
- nothing to commit (use -u to show untracked files)
436
- EOF
425
+ cat >expected <<EOF &&
426
+rebase in progress; onto $ONTO
427
+You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
428
+ (use "git commit --amend" to amend the current commit)
429
+ (use "git rebase --continue" once you are satisfied with your changes)
430
+
431
+nothing to commit (use -u to show untracked files)
432
+EOF
433
git status --untracked-files=no >actual &&
434
test_i18ncmp expected actual
435
'
@@ -451,19 +447,19 @@ test_expect_success 'status: (split first edit) second edit and split' '
447
git commit --amend -m "f" &&
448
git rebase --continue &&
449
git reset HEAD^ &&
454
- cat >expected <<-EOF &&
455
- # rebase in progress; onto $ONTO
456
- # You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
457
- # (Once your working directory is clean, run "git rebase --continue")
458
- #
459
- # Changes not staged for commit:
460
- # (use "git add <file>..." to update what will be committed)
461
- # (use "git checkout -- <file>..." to discard changes in working directory)
462
- #
463
- # modified: main.txt
464
- #
465
- no changes added to commit (use "git add" and/or "git commit -a")
466
- EOF
450
+ cat >expected <<EOF &&
451
+rebase in progress; onto $ONTO
452
+You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
453
+ (Once your working directory is clean, run "git rebase --continue")
454
+
455
+Changes not staged for commit:
456
+ (use "git add <file>..." to update what will be committed)
457
+ (use "git checkout -- <file>..." to discard changes in working directory)
458
+
459
+ modified: main.txt
460
+
461
+no changes added to commit (use "git add" and/or "git commit -a")
462
+EOF
463
git status --untracked-files=no >actual &&
464
test_i18ncmp expected actual
465
'
@@ -481,14 +477,14 @@ test_expect_success 'status: (split first edit) second edit and amend' '
477
git commit --amend -m "g" &&
478
git rebase --continue &&
479
git commit --amend -m "h" &&
484
- cat >expected <<-EOF &&
485
- # rebase in progress; onto $ONTO
486
- # You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
487
- # (use "git commit --amend" to amend the current commit)
488
- # (use "git rebase --continue" once you are satisfied with your changes)
489
- #
490
- nothing to commit (use -u to show untracked files)
491
- EOF
480
+ cat >expected <<EOF &&
481
+rebase in progress; onto $ONTO
482
+You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
483
+ (use "git commit --amend" to amend the current commit)
484
+ (use "git rebase --continue" once you are satisfied with your changes)
485
+
486
+nothing to commit (use -u to show untracked files)
487
+EOF
488
git status --untracked-files=no >actual &&
489
test_i18ncmp expected actual
490
'
@@ -508,15 +504,15 @@ test_expect_success 'status in an am session: file already exists' '
504
test_when_finished "rm Maildir/* && git am --abort" &&
505
git format-patch -1 -oMaildir &&
506
test_must_fail git am Maildir/*.patch &&
511
- cat >expected <<-\EOF &&
512
- # On branch am_already_exists
513
- # You are in the middle of an am session.
514
- # (fix conflicts and then run "git am --continue")
515
- # (use "git am --skip" to skip this patch)
516
- # (use "git am --abort" to restore the original branch)
517
- #
518
- nothing to commit (use -u to show untracked files)
519
- EOF
507
+ cat >expected <<\EOF &&
508
+On branch am_already_exists
509
+You are in the middle of an am session.
510
+ (fix conflicts and then run "git am --continue")
511
+ (use "git am --skip" to skip this patch)
512
+ (use "git am --abort" to restore the original branch)
513
+
514
+nothing to commit (use -u to show untracked files)
515
+EOF
516
git status --untracked-files=no >actual &&
517
test_i18ncmp expected actual
518
'
@@ -530,15 +526,15 @@ test_expect_success 'status in an am session: file does not exist' '
526
test_when_finished "rm Maildir/* && git am --abort" &&
527
git format-patch -1 -oMaildir &&
528
test_must_fail git am Maildir/*.patch &&
533
- cat >expected <<-\EOF &&
534
- # On branch am_not_exists
535
- # You are in the middle of an am session.
536
- # (fix conflicts and then run "git am --continue")
537
- # (use "git am --skip" to skip this patch)
538
- # (use "git am --abort" to restore the original branch)
539
- #
540
- nothing to commit (use -u to show untracked files)
541
- EOF
529
+ cat >expected <<\EOF &&
530
+On branch am_not_exists
531
+You are in the middle of an am session.
532
+ (fix conflicts and then run "git am --continue")
533
+ (use "git am --skip" to skip this patch)
534
+ (use "git am --abort" to restore the original branch)
535
+
536
+nothing to commit (use -u to show untracked files)
537
+EOF
538
git status --untracked-files=no >actual &&
539
test_i18ncmp expected actual
540
'
@@ -553,15 +549,15 @@ test_expect_success 'status in an am session: empty patch' '
549
git commit -m "delete all am_empty" &&
550
echo error >Maildir/0002-two_am.patch &&
551
test_must_fail git am Maildir/*.patch &&
556
- cat >expected <<-\EOF &&
557
- # On branch am_empty
558
- # You are in the middle of an am session.
559
- # The current patch is empty.
560
- # (use "git am --skip" to skip this patch)
561
- # (use "git am --abort" to restore the original branch)
562
- #
563
- nothing to commit (use -u to show untracked files)
564
- EOF
552
+ cat >expected <<\EOF &&
553
+On branch am_empty
554
+You are in the middle of an am session.
555
+The current patch is empty.
556
+ (use "git am --skip" to skip this patch)
557
+ (use "git am --abort" to restore the original branch)
558
+
559
+nothing to commit (use -u to show untracked files)
560
+EOF
561
git status --untracked-files=no >actual &&
562
test_i18ncmp expected actual
563
'
@@ -578,13 +574,13 @@ test_expect_success 'status when bisecting' '
574
git bisect bad &&
575
git bisect good one_bisect &&
576
TGT=$(git rev-parse --short two_bisect) &&
581
- cat >expected <<-EOF &&
582
- # HEAD detached at $TGT
583
- # You are currently bisecting, started from branch '\''bisect'\''.
584
- # (use "git bisect reset" to get back to the original branch)
585
- #
586
- nothing to commit (use -u to show untracked files)
587
- EOF
577
+ cat >expected <<EOF &&
578
+HEAD detached at $TGT
579
+You are currently bisecting, started from branch '\''bisect'\''.
580
+ (use "git bisect reset" to get back to the original branch)
581
+
582
+nothing to commit (use -u to show untracked files)
583
+EOF
584
git status --untracked-files=no >actual &&
585
test_i18ncmp expected actual
586
'
@@ -601,15 +597,15 @@ test_expect_success 'status when rebase conflicts with statushints disabled' '
597
test_when_finished "git rebase --abort" &&
598
ONTO=$(git rev-parse --short HEAD^^) &&
599
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
604
- cat >expected <<-EOF &&
605
- # rebase in progress; onto $ONTO
606
- # You are currently rebasing branch '\''statushints_disabled'\'' on '\''$ONTO'\''.
607
- #
608
- # Unmerged paths:
609
- # both modified: main.txt
610
- #
611
- no changes added to commit
612
- EOF
600
+ cat >expected <<EOF &&
601
+rebase in progress; onto $ONTO
602
+You are currently rebasing branch '\''statushints_disabled'\'' on '\''$ONTO'\''.
603
+
604
+Unmerged paths:
605
+ both modified: main.txt
606
+
607
+no changes added to commit
608
+EOF
609
git status --untracked-files=no >actual &&
610
test_i18ncmp expected actual
611
'
@@ -630,19 +626,19 @@ test_expect_success 'prepare for cherry-pick conflicts' '
626
test_expect_success 'status when cherry-picking before resolving conflicts' '
627
test_when_finished "git cherry-pick --abort" &&
628
test_must_fail git cherry-pick cherry_branch_second &&
633
- cat >expected <<-\EOF &&
634
- # On branch cherry_branch
635
- # You are currently cherry-picking.
636
- # (fix conflicts and run "git cherry-pick --continue")
637
- # (use "git cherry-pick --abort" to cancel the cherry-pick operation)
638
- #
639
- # Unmerged paths:
640
- # (use "git add <file>..." to mark resolution)
641
- #
642
- # both modified: main.txt
643
- #
644
- no changes added to commit (use "git add" and/or "git commit -a")
645
- EOF
629
+ cat >expected <<\EOF &&
630
+On branch cherry_branch
631
+You are currently cherry-picking.
632
+ (fix conflicts and run "git cherry-pick --continue")
633
+ (use "git cherry-pick --abort" to cancel the cherry-pick operation)
634
+
635
+Unmerged paths:
636
+ (use "git add <file>..." to mark resolution)
637
+
638
+ both modified: main.txt
639
+
640
+no changes added to commit (use "git add" and/or "git commit -a")
641
+EOF
642
git status --untracked-files=no >actual &&
643
test_i18ncmp expected actual
644
'
@@ -654,18 +650,18 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
650
test_must_fail git cherry-pick cherry_branch_second &&
651
echo end >main.txt &&
652
git add main.txt &&
657
- cat >expected <<-\EOF &&
658
- # On branch cherry_branch
659
- # You are currently cherry-picking.
660
- # (all conflicts fixed: run "git cherry-pick --continue")
661
- # (use "git cherry-pick --abort" to cancel the cherry-pick operation)
662
- #
663
- # Changes to be committed:
664
- #
665
- # modified: main.txt
666
- #
667
- # Untracked files not listed (use -u option to show untracked files)
668
- EOF
653
+ cat >expected <<\EOF &&
654
+On branch cherry_branch
655
+You are currently cherry-picking.
656
+ (all conflicts fixed: run "git cherry-pick --continue")
657
+ (use "git cherry-pick --abort" to cancel the cherry-pick operation)
658
+
659
+Changes to be committed:
660
+
661
+ modified: main.txt
662
+
663
+Untracked files not listed (use -u option to show untracked files)
664
+EOF
665
git status --untracked-files=no >actual &&
666
test_i18ncmp expected actual
667
'
@@ -673,18 +669,18 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
669
test_expect_success 'status showing detached at and from a tag' '
670
test_commit atag tagging &&
671
git checkout atag &&
676
- cat >expected <<-\EOF
677
- # HEAD detached at atag
678
- nothing to commit (use -u to show untracked files)
679
- EOF
672
+ cat >expected <<\EOF
673
+HEAD detached at atag
674
+nothing to commit (use -u to show untracked files)
675
+EOF
676
git status --untracked-files=no >actual &&
677
test_i18ncmp expected actual &&
678
679
git reset --hard HEAD^ &&
684
- cat >expected <<-\EOF
685
- # HEAD detached from atag
686
- nothing to commit (use -u to show untracked files)
687
- EOF
680
+ cat >expected <<\EOF
681
+HEAD detached from atag
682
+nothing to commit (use -u to show untracked files)
683
+EOF
684
git status --untracked-files=no >actual &&
685
test_i18ncmp expected actual
686
'
@@ -699,20 +695,20 @@ test_expect_success 'status while reverting commit (conflicts)' '
695
test_commit new to-revert.txt &&
696
TO_REVERT=$(git rev-parse --short HEAD^) &&
697
test_must_fail git revert $TO_REVERT &&
702
- cat >expected <<-EOF
703
- # On branch master
704
- # You are currently reverting commit $TO_REVERT.
705
- # (fix conflicts and run "git revert --continue")
706
- # (use "git revert --abort" to cancel the revert operation)
707
- #
708
- # Unmerged paths:
709
- # (use "git reset HEAD <file>..." to unstage)
710
- # (use "git add <file>..." to mark resolution)
711
- #
712
- # both modified: to-revert.txt
713
- #
714
- no changes added to commit (use "git add" and/or "git commit -a")
715
- EOF
698
+ cat >expected <<EOF
699
+On branch master
700
+You are currently reverting commit $TO_REVERT.
701
+ (fix conflicts and run "git revert --continue")
702
+ (use "git revert --abort" to cancel the revert operation)
703
+
704
+Unmerged paths:
705
+ (use "git reset HEAD <file>..." to unstage)
706
+ (use "git add <file>..." to mark resolution)
707
+
708
+ both modified: to-revert.txt
709
+
710
+no changes added to commit (use "git add" and/or "git commit -a")
711
+EOF
712
git status --untracked-files=no >actual &&
713
test_i18ncmp expected actual
714
'
@@ -720,29 +716,29 @@ test_expect_success 'status while reverting commit (conflicts)' '
716
test_expect_success 'status while reverting commit (conflicts resolved)' '
717
echo reverted >to-revert.txt &&
718
git add to-revert.txt &&
723
- cat >expected <<-EOF
724
- # On branch master
725
- # You are currently reverting commit $TO_REVERT.
726
- # (all conflicts fixed: run "git revert --continue")
727
- # (use "git revert --abort" to cancel the revert operation)
728
- #
729
- # Changes to be committed:
730
- # (use "git reset HEAD <file>..." to unstage)
731
- #
732
- # modified: to-revert.txt
733
- #
734
- # Untracked files not listed (use -u option to show untracked files)
735
- EOF
719
+ cat >expected <<EOF
720
+On branch master
721
+You are currently reverting commit $TO_REVERT.
722
+ (all conflicts fixed: run "git revert --continue")
723
+ (use "git revert --abort" to cancel the revert operation)
724
+
725
+Changes to be committed:
726
+ (use "git reset HEAD <file>..." to unstage)
727
+
728
+ modified: to-revert.txt
729
+
730
+Untracked files not listed (use -u option to show untracked files)
731
+EOF
732
git status --untracked-files=no >actual &&
733
test_i18ncmp expected actual
734
'
735
736
test_expect_success 'status after reverting commit' '
737
git revert --continue &&
742
- cat >expected <<-\EOF
743
- # On branch master
744
- nothing to commit (use -u to show untracked files)
745
- EOF
738
+ cat >expected <<\EOF
739
+On branch master
740
+nothing to commit (use -u to show untracked files)
741
+EOF
742
git status --untracked-files=no >actual &&
743
test_i18ncmp expected actual
744
'