status: disable display of '#' comment prefix by default
[git.git] / t / t7512-status-help.sh
blob312f41765feefe38fef57bdc2f6d8a73b2476b05
1 #!/bin/sh
3 # Copyright (c) 2012 Valentin Duperray, Lucien Kong, Franck Jonas,
4 # Thomas Nguy, Khoi Nguyen
5 # Grenoble INP Ensimag
8 test_description='git status advice'
10 . ./test-lib.sh
12 . "$TEST_DIRECTORY"/lib-rebase.sh
14 set_fake_editor
16 test_expect_success 'use status.displayCommentPrefix by default ' '
17 git config --global status.displayCommentPrefix true
20 test_expect_success 'prepare for conflicts' '
21 git config --global advice.statusuoption false &&
22 test_commit init main.txt init &&
23 git branch conflicts &&
24 test_commit on_master main.txt on_master &&
25 git checkout conflicts &&
26 test_commit on_conflicts main.txt on_conflicts
30 test_expect_success 'status when conflicts unresolved' '
31 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")
37 # Unmerged paths:
38 # (use "git add <file>..." to mark resolution)
40 # both modified: main.txt
42 no changes added to commit (use "git add" and/or "git commit -a")
43 EOF
44 git status --untracked-files=no >actual &&
45 test_i18ncmp expected actual
49 test_expect_success 'status when conflicts resolved before commit' '
50 git reset --hard conflicts &&
51 test_must_fail git merge master &&
52 echo one >main.txt &&
53 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)
59 # Changes to be committed:
61 # modified: main.txt
63 # Untracked files not listed (use -u option to show untracked files)
64 EOF
65 git status --untracked-files=no >actual &&
66 test_i18ncmp expected actual
70 test_expect_success 'prepare for rebase conflicts' '
71 git reset --hard master &&
72 git checkout -b rebase_conflicts &&
73 test_commit one_rebase main.txt one &&
74 test_commit two_rebase main.txt two &&
75 test_commit three_rebase main.txt three
79 test_expect_success 'status when rebase in progress before resolving conflicts' '
80 test_when_finished "git rebase --abort" &&
81 ONTO=$(git rev-parse --short HEAD^^) &&
82 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)
90 # Unmerged paths:
91 # (use "git reset HEAD <file>..." to unstage)
92 # (use "git add <file>..." to mark resolution)
94 # both modified: main.txt
96 no changes added to commit (use "git add" and/or "git commit -a")
97 EOF
98 git status --untracked-files=no >actual &&
99 test_i18ncmp expected actual
103 test_expect_success 'status when rebase in progress before rebase --continue' '
104 git reset --hard rebase_conflicts &&
105 test_when_finished "git rebase --abort" &&
106 ONTO=$(git rev-parse --short HEAD^^) &&
107 test_must_fail git rebase HEAD^ --onto HEAD^^ &&
108 echo three >main.txt &&
109 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")
115 # Changes to be committed:
116 # (use "git reset HEAD <file>..." to unstage)
118 # modified: main.txt
120 # Untracked files not listed (use -u option to show untracked files)
122 git status --untracked-files=no >actual &&
123 test_i18ncmp expected actual
127 test_expect_success 'prepare for rebase_i_conflicts' '
128 git reset --hard master &&
129 git checkout -b rebase_i_conflicts &&
130 test_commit one_unmerge main.txt one_unmerge &&
131 git branch rebase_i_conflicts_second &&
132 test_commit one_master main.txt one_master &&
133 git checkout rebase_i_conflicts_second &&
134 test_commit one_second main.txt one_second
138 test_expect_success 'status during rebase -i when conflicts unresolved' '
139 test_when_finished "git rebase --abort" &&
140 ONTO=$(git rev-parse --short rebase_i_conflicts) &&
141 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)
149 # Unmerged paths:
150 # (use "git reset HEAD <file>..." to unstage)
151 # (use "git add <file>..." to mark resolution)
153 # both modified: main.txt
155 no changes added to commit (use "git add" and/or "git commit -a")
157 git status --untracked-files=no >actual &&
158 test_i18ncmp expected actual
162 test_expect_success 'status during rebase -i after resolving conflicts' '
163 git reset --hard rebase_i_conflicts_second &&
164 test_when_finished "git rebase --abort" &&
165 ONTO=$(git rev-parse --short rebase_i_conflicts) &&
166 test_must_fail git rebase -i rebase_i_conflicts &&
167 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")
173 # Changes to be committed:
174 # (use "git reset HEAD <file>..." to unstage)
176 # modified: main.txt
178 # Untracked files not listed (use -u option to show untracked files)
180 git status --untracked-files=no >actual &&
181 test_i18ncmp expected actual
185 test_expect_success 'status when rebasing -i in edit mode' '
186 git reset --hard master &&
187 git checkout -b rebase_i_edit &&
188 test_commit one_rebase_i main.txt one &&
189 test_commit two_rebase_i main.txt two &&
190 test_commit three_rebase_i main.txt three &&
191 FAKE_LINES="1 edit 2" &&
192 export FAKE_LINES &&
193 test_when_finished "git rebase --abort" &&
194 ONTO=$(git rev-parse --short HEAD~2) &&
195 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)
202 nothing to commit (use -u to show untracked files)
204 git status --untracked-files=no >actual &&
205 test_i18ncmp expected actual
209 test_expect_success 'status when splitting a commit' '
210 git reset --hard master &&
211 git checkout -b split_commit &&
212 test_commit one_split main.txt one &&
213 test_commit two_split main.txt two &&
214 test_commit three_split main.txt three &&
215 test_commit four_split main.txt four &&
216 FAKE_LINES="1 edit 2 3" &&
217 export FAKE_LINES &&
218 test_when_finished "git rebase --abort" &&
219 ONTO=$(git rev-parse --short HEAD~3) &&
220 git rebase -i HEAD~3 &&
221 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")
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)
231 # modified: main.txt
233 no changes added to commit (use "git add" and/or "git commit -a")
235 git status --untracked-files=no >actual &&
236 test_i18ncmp expected actual
240 test_expect_success 'status after editing the last commit with --amend during a rebase -i' '
241 git reset --hard master &&
242 git checkout -b amend_last &&
243 test_commit one_amend main.txt one &&
244 test_commit two_amend main.txt two &&
245 test_commit three_amend main.txt three &&
246 test_commit four_amend main.txt four &&
247 FAKE_LINES="1 2 edit 3" &&
248 export FAKE_LINES &&
249 test_when_finished "git rebase --abort" &&
250 ONTO=$(git rev-parse --short HEAD~3) &&
251 git rebase -i HEAD~3 &&
252 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)
259 nothing to commit (use -u to show untracked files)
261 git status --untracked-files=no >actual &&
262 test_i18ncmp expected actual
266 test_expect_success 'prepare for several edits' '
267 git reset --hard master &&
268 git checkout -b several_edits &&
269 test_commit one_edits main.txt one &&
270 test_commit two_edits main.txt two &&
271 test_commit three_edits main.txt three &&
272 test_commit four_edits main.txt four
276 test_expect_success 'status: (continue first edit) second edit' '
277 FAKE_LINES="edit 1 edit 2 3" &&
278 export FAKE_LINES &&
279 test_when_finished "git rebase --abort" &&
280 ONTO=$(git rev-parse --short HEAD~3) &&
281 git rebase -i HEAD~3 &&
282 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)
289 nothing to commit (use -u to show untracked files)
291 git status --untracked-files=no >actual &&
292 test_i18ncmp expected actual
296 test_expect_success 'status: (continue first edit) second edit and split' '
297 git reset --hard several_edits &&
298 FAKE_LINES="edit 1 edit 2 3" &&
299 export FAKE_LINES &&
300 test_when_finished "git rebase --abort" &&
301 ONTO=$(git rev-parse --short HEAD~3) &&
302 git rebase -i HEAD~3 &&
303 git rebase --continue &&
304 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")
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)
314 # modified: main.txt
316 no changes added to commit (use "git add" and/or "git commit -a")
318 git status --untracked-files=no >actual &&
319 test_i18ncmp expected actual
323 test_expect_success 'status: (continue first edit) second edit and amend' '
324 git reset --hard several_edits &&
325 FAKE_LINES="edit 1 edit 2 3" &&
326 export FAKE_LINES &&
327 test_when_finished "git rebase --abort" &&
328 ONTO=$(git rev-parse --short HEAD~3) &&
329 git rebase -i HEAD~3 &&
330 git rebase --continue &&
331 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)
338 nothing to commit (use -u to show untracked files)
340 git status --untracked-files=no >actual &&
341 test_i18ncmp expected actual
345 test_expect_success 'status: (amend first edit) second edit' '
346 git reset --hard several_edits &&
347 FAKE_LINES="edit 1 edit 2 3" &&
348 export FAKE_LINES &&
349 test_when_finished "git rebase --abort" &&
350 ONTO=$(git rev-parse --short HEAD~3) &&
351 git rebase -i HEAD~3 &&
352 git commit --amend -m "a" &&
353 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)
360 nothing to commit (use -u to show untracked files)
362 git status --untracked-files=no >actual &&
363 test_i18ncmp expected actual
367 test_expect_success 'status: (amend first edit) second edit and split' '
368 git reset --hard several_edits &&
369 FAKE_LINES="edit 1 edit 2 3" &&
370 export FAKE_LINES &&
371 test_when_finished "git rebase --abort" &&
372 ONTO=$(git rev-parse --short HEAD~3) &&
373 git rebase -i HEAD~3 &&
374 git commit --amend -m "b" &&
375 git rebase --continue &&
376 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")
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)
386 # modified: main.txt
388 no changes added to commit (use "git add" and/or "git commit -a")
390 git status --untracked-files=no >actual &&
391 test_i18ncmp expected actual
395 test_expect_success 'status: (amend first edit) second edit and amend' '
396 git reset --hard several_edits &&
397 FAKE_LINES="edit 1 edit 2 3" &&
398 export FAKE_LINES &&
399 test_when_finished "git rebase --abort" &&
400 ONTO=$(git rev-parse --short HEAD~3) &&
401 git rebase -i HEAD~3 &&
402 git commit --amend -m "c" &&
403 git rebase --continue &&
404 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)
411 nothing to commit (use -u to show untracked files)
413 git status --untracked-files=no >actual &&
414 test_i18ncmp expected actual
418 test_expect_success 'status: (split first edit) second edit' '
419 git reset --hard several_edits &&
420 FAKE_LINES="edit 1 edit 2 3" &&
421 export FAKE_LINES &&
422 test_when_finished "git rebase --abort" &&
423 ONTO=$(git rev-parse --short HEAD~3) &&
424 git rebase -i HEAD~3 &&
425 git reset HEAD^ &&
426 git add main.txt &&
427 git commit -m "e" &&
428 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)
435 nothing to commit (use -u to show untracked files)
437 git status --untracked-files=no >actual &&
438 test_i18ncmp expected actual
442 test_expect_success 'status: (split first edit) second edit and split' '
443 git reset --hard several_edits &&
444 FAKE_LINES="edit 1 edit 2 3" &&
445 export FAKE_LINES &&
446 test_when_finished "git rebase --abort" &&
447 ONTO=$(git rev-parse --short HEAD~3) &&
448 git rebase -i HEAD~3 &&
449 git reset HEAD^ &&
450 git add main.txt &&
451 git commit --amend -m "f" &&
452 git rebase --continue &&
453 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")
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)
463 # modified: main.txt
465 no changes added to commit (use "git add" and/or "git commit -a")
467 git status --untracked-files=no >actual &&
468 test_i18ncmp expected actual
472 test_expect_success 'status: (split first edit) second edit and amend' '
473 git reset --hard several_edits &&
474 FAKE_LINES="edit 1 edit 2 3" &&
475 export FAKE_LINES &&
476 test_when_finished "git rebase --abort" &&
477 ONTO=$(git rev-parse --short HEAD~3) &&
478 git rebase -i HEAD~3 &&
479 git reset HEAD^ &&
480 git add main.txt &&
481 git commit --amend -m "g" &&
482 git rebase --continue &&
483 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)
490 nothing to commit (use -u to show untracked files)
492 git status --untracked-files=no >actual &&
493 test_i18ncmp expected actual
497 test_expect_success 'prepare am_session' '
498 git reset --hard master &&
499 git checkout -b am_session &&
500 test_commit one_am one.txt "one" &&
501 test_commit two_am two.txt "two" &&
502 test_commit three_am three.txt "three"
506 test_expect_success 'status in an am session: file already exists' '
507 git checkout -b am_already_exists &&
508 test_when_finished "rm Maildir/* && git am --abort" &&
509 git format-patch -1 -oMaildir &&
510 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)
518 nothing to commit (use -u to show untracked files)
520 git status --untracked-files=no >actual &&
521 test_i18ncmp expected actual
525 test_expect_success 'status in an am session: file does not exist' '
526 git reset --hard am_session &&
527 git checkout -b am_not_exists &&
528 git rm three.txt &&
529 git commit -m "delete three.txt" &&
530 test_when_finished "rm Maildir/* && git am --abort" &&
531 git format-patch -1 -oMaildir &&
532 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)
540 nothing to commit (use -u to show untracked files)
542 git status --untracked-files=no >actual &&
543 test_i18ncmp expected actual
547 test_expect_success 'status in an am session: empty patch' '
548 git reset --hard am_session &&
549 git checkout -b am_empty &&
550 test_when_finished "rm Maildir/* && git am --abort" &&
551 git format-patch -3 -oMaildir &&
552 git rm one.txt two.txt three.txt &&
553 git commit -m "delete all am_empty" &&
554 echo error >Maildir/0002-two_am.patch &&
555 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)
563 nothing to commit (use -u to show untracked files)
565 git status --untracked-files=no >actual &&
566 test_i18ncmp expected actual
570 test_expect_success 'status when bisecting' '
571 git reset --hard master &&
572 git checkout -b bisect &&
573 test_commit one_bisect main.txt one &&
574 test_commit two_bisect main.txt two &&
575 test_commit three_bisect main.txt three &&
576 test_when_finished "git bisect reset" &&
577 git bisect start &&
578 git bisect bad &&
579 git bisect good one_bisect &&
580 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)
586 nothing to commit (use -u to show untracked files)
588 git status --untracked-files=no >actual &&
589 test_i18ncmp expected actual
593 test_expect_success 'status when rebase conflicts with statushints disabled' '
594 git reset --hard master &&
595 git checkout -b statushints_disabled &&
596 test_when_finished "git config --local advice.statushints true" &&
597 git config --local advice.statushints false &&
598 test_commit one_statushints main.txt one &&
599 test_commit two_statushints main.txt two &&
600 test_commit three_statushints main.txt three &&
601 test_when_finished "git rebase --abort" &&
602 ONTO=$(git rev-parse --short HEAD^^) &&
603 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'\''.
608 # Unmerged paths:
609 # both modified: main.txt
611 no changes added to commit
613 git status --untracked-files=no >actual &&
614 test_i18ncmp expected actual
618 test_expect_success 'prepare for cherry-pick conflicts' '
619 git reset --hard master &&
620 git checkout -b cherry_branch &&
621 test_commit one_cherry main.txt one &&
622 test_commit two_cherries main.txt two &&
623 git checkout -b cherry_branch_second &&
624 test_commit second_cherry main.txt second &&
625 git checkout cherry_branch &&
626 test_commit three_cherries main.txt three
630 test_expect_success 'status when cherry-picking before resolving conflicts' '
631 test_when_finished "git cherry-pick --abort" &&
632 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)
639 # Unmerged paths:
640 # (use "git add <file>..." to mark resolution)
642 # both modified: main.txt
644 no changes added to commit (use "git add" and/or "git commit -a")
646 git status --untracked-files=no >actual &&
647 test_i18ncmp expected actual
651 test_expect_success 'status when cherry-picking after resolving conflicts' '
652 git reset --hard cherry_branch &&
653 test_when_finished "git cherry-pick --abort" &&
654 test_must_fail git cherry-pick cherry_branch_second &&
655 echo end >main.txt &&
656 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)
663 # Changes to be committed:
665 # modified: main.txt
667 # Untracked files not listed (use -u option to show untracked files)
669 git status --untracked-files=no >actual &&
670 test_i18ncmp expected actual
673 test_expect_success 'status showing detached at and from a tag' '
674 test_commit atag tagging &&
675 git checkout atag &&
676 cat >expected <<-\EOF
677 # HEAD detached at atag
678 nothing to commit (use -u to show untracked files)
680 git status --untracked-files=no >actual &&
681 test_i18ncmp expected actual &&
683 git reset --hard HEAD^ &&
684 cat >expected <<-\EOF
685 # HEAD detached from atag
686 nothing to commit (use -u to show untracked files)
688 git status --untracked-files=no >actual &&
689 test_i18ncmp expected actual
692 test_expect_success 'status while reverting commit (conflicts)' '
693 git checkout master &&
694 echo before >to-revert.txt &&
695 test_commit before to-revert.txt &&
696 echo old >to-revert.txt &&
697 test_commit old to-revert.txt &&
698 echo new >to-revert.txt &&
699 test_commit new to-revert.txt &&
700 TO_REVERT=$(git rev-parse --short HEAD^) &&
701 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)
708 # Unmerged paths:
709 # (use "git reset HEAD <file>..." to unstage)
710 # (use "git add <file>..." to mark resolution)
712 # both modified: to-revert.txt
714 no changes added to commit (use "git add" and/or "git commit -a")
716 git status --untracked-files=no >actual &&
717 test_i18ncmp expected actual
720 test_expect_success 'status while reverting commit (conflicts resolved)' '
721 echo reverted >to-revert.txt &&
722 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)
729 # Changes to be committed:
730 # (use "git reset HEAD <file>..." to unstage)
732 # modified: to-revert.txt
734 # Untracked files not listed (use -u option to show untracked files)
736 git status --untracked-files=no >actual &&
737 test_i18ncmp expected actual
740 test_expect_success 'status after reverting commit' '
741 git revert --continue &&
742 cat >expected <<-\EOF
743 # On branch master
744 nothing to commit (use -u to show untracked files)
746 git status --untracked-files=no >actual &&
747 test_i18ncmp expected actual
750 test_done