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>
This commit is contained in:
Matthieu Moy 2013-09-06 19:43:08 +02:00 committed by Junio C Hamano
parent 2556b9962e
commit 1c7969c933
3 changed files with 793 additions and 813 deletions

View File

@ -4,10 +4,6 @@ test_description='basic work tree status reporting'
. ./test-lib.sh
test_expect_success 'use status.displayCommentPrefix by default ' '
git config --global status.displayCommentPrefix true
'
test_expect_success setup '
git config --global advice.statusuoption false &&
test_commit A &&
@ -33,20 +29,19 @@ test_expect_success 'Report new path with conflict' '
test_cmp expect actual
'
cat >expect <<EOF
# On branch side
# You have unmerged paths.
# (fix conflicts and run "git commit")
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# deleted by us: foo
#
test_expect_success 'M/D conflict does not segfault' '
cat >expect <<EOF &&
On branch side
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)
deleted by us: foo
no changes added to commit (use "git add" and/or "git commit -a")
EOF
test_expect_success 'M/D conflict does not segfault' '
mkdir mdconflict &&
(
cd mdconflict &&
@ -139,17 +134,17 @@ test_expect_success 'status when conflicts with add and rm advice (deleted by th
test_commit on_second main.txt on_second &&
test_commit master conflict.txt master &&
test_must_fail git merge second_branch &&
cat >expected <<-\EOF &&
# On branch master
# You have unmerged paths.
# (fix conflicts and run "git commit")
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both added: conflict.txt
# deleted by them: main.txt
#
cat >expected <<\EOF &&
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)
both added: conflict.txt
deleted by them: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -172,18 +167,18 @@ test_expect_success 'prepare for conflicts' '
test_expect_success 'status when conflicts with add and rm advice (both deleted)' '
test_must_fail git merge conflict &&
cat >expected <<-\EOF &&
# On branch conflict_second
# You have unmerged paths.
# (fix conflicts and run "git commit")
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both deleted: main.txt
# added by them: sub_master.txt
# added by us: sub_second.txt
#
cat >expected <<\EOF &&
On branch conflict_second
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)
both deleted: main.txt
added by them: sub_master.txt
added by us: sub_second.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -196,21 +191,21 @@ test_expect_success 'status when conflicts with only rm advice (both deleted)' '
test_must_fail git merge conflict &&
git add sub_master.txt &&
git add sub_second.txt &&
cat >expected <<-\EOF &&
# On branch conflict_second
# You have unmerged paths.
# (fix conflicts and run "git commit")
#
# Changes to be committed:
#
# new file: sub_master.txt
#
# Unmerged paths:
# (use "git rm <file>..." to mark resolution)
#
# both deleted: main.txt
#
# Untracked files not listed (use -u option to show untracked files)
cat >expected <<\EOF &&
On branch conflict_second
You have unmerged paths.
(fix conflicts and run "git commit")
Changes to be committed:
new file: sub_master.txt
Unmerged paths:
(use "git rm <file>..." to mark resolution)
both deleted: main.txt
Untracked files not listed (use -u option to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual &&

File diff suppressed because it is too large Load Diff

View File

@ -13,10 +13,6 @@ test_description='git status advice'
set_fake_editor
test_expect_success 'use status.displayCommentPrefix by default ' '
git config --global status.displayCommentPrefix true
'
test_expect_success 'prepare for conflicts' '
git config --global advice.statusuoption false &&
test_commit init main.txt init &&
@ -29,16 +25,16 @@ test_expect_success 'prepare for conflicts' '
test_expect_success 'status when conflicts unresolved' '
test_must_fail git merge master &&
cat >expected <<-\EOF &&
# On branch conflicts
# You have unmerged paths.
# (fix conflicts and run "git commit")
#
# Unmerged paths:
# (use "git add <file>..." to mark resolution)
#
# both modified: main.txt
#
cat >expected <<\EOF &&
On branch conflicts
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -51,16 +47,16 @@ test_expect_success 'status when conflicts resolved before commit' '
test_must_fail git merge master &&
echo one >main.txt &&
git add main.txt &&
cat >expected <<-\EOF &&
# On branch conflicts
# All conflicts fixed but you are still merging.
# (use "git commit" to conclude merge)
#
# Changes to be committed:
#
# modified: main.txt
#
# Untracked files not listed (use -u option to show untracked files)
cat >expected <<\EOF &&
On branch conflicts
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Changes to be committed:
modified: main.txt
Untracked files not listed (use -u option to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
@ -80,19 +76,19 @@ test_expect_success 'status when rebase in progress before resolving conflicts'
test_when_finished "git rebase --abort" &&
ONTO=$(git rev-parse --short HEAD^^) &&
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
# (fix conflicts and then run "git rebase --continue")
# (use "git rebase --skip" to skip this patch)
# (use "git rebase --abort" to check out the original branch)
#
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add <file>..." to mark resolution)
#
# both modified: main.txt
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
(fix conflicts and then run "git rebase --continue")
(use "git rebase --skip" to skip this patch)
(use "git rebase --abort" to check out the original branch)
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -107,17 +103,17 @@ test_expect_success 'status when rebase in progress before rebase --continue' '
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
echo three >main.txt &&
git add main.txt &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
# (all conflicts fixed: run "git rebase --continue")
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: main.txt
#
# Untracked files not listed (use -u option to show untracked files)
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
(all conflicts fixed: run "git rebase --continue")
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: main.txt
Untracked files not listed (use -u option to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
@ -139,19 +135,19 @@ test_expect_success 'status during rebase -i when conflicts unresolved' '
test_when_finished "git rebase --abort" &&
ONTO=$(git rev-parse --short rebase_i_conflicts) &&
test_must_fail git rebase -i rebase_i_conflicts &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
# (fix conflicts and then run "git rebase --continue")
# (use "git rebase --skip" to skip this patch)
# (use "git rebase --abort" to check out the original branch)
#
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add <file>..." to mark resolution)
#
# both modified: main.txt
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
(fix conflicts and then run "git rebase --continue")
(use "git rebase --skip" to skip this patch)
(use "git rebase --abort" to check out the original branch)
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -165,17 +161,17 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
ONTO=$(git rev-parse --short rebase_i_conflicts) &&
test_must_fail git rebase -i rebase_i_conflicts &&
git add main.txt &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
# (all conflicts fixed: run "git rebase --continue")
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: main.txt
#
# Untracked files not listed (use -u option to show untracked files)
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
(all conflicts fixed: run "git rebase --continue")
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: main.txt
Untracked files not listed (use -u option to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
@ -193,12 +189,12 @@ test_expect_success 'status when rebasing -i in edit mode' '
test_when_finished "git rebase --abort" &&
ONTO=$(git rev-parse --short HEAD~2) &&
git rebase -i HEAD~2 &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently editing a commit while rebasing branch '\''rebase_i_edit'\'' on '\''$ONTO'\''.
# (use "git commit --amend" to amend the current commit)
# (use "git rebase --continue" once you are satisfied with your changes)
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently editing a commit while rebasing branch '\''rebase_i_edit'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -219,17 +215,17 @@ test_expect_success 'status when splitting a commit' '
ONTO=$(git rev-parse --short HEAD~3) &&
git rebase -i HEAD~3 &&
git reset HEAD^ &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
# (Once your working directory is clean, run "git rebase --continue")
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: main.txt
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
(Once your working directory is clean, run "git rebase --continue")
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -250,12 +246,12 @@ test_expect_success 'status after editing the last commit with --amend during a
ONTO=$(git rev-parse --short HEAD~3) &&
git rebase -i HEAD~3 &&
git commit --amend -m "foo" &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
# (use "git commit --amend" to amend the current commit)
# (use "git rebase --continue" once you are satisfied with your changes)
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -280,12 +276,12 @@ test_expect_success 'status: (continue first edit) second edit' '
ONTO=$(git rev-parse --short HEAD~3) &&
git rebase -i HEAD~3 &&
git rebase --continue &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (use "git commit --amend" to amend the current commit)
# (use "git rebase --continue" once you are satisfied with your changes)
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -302,17 +298,17 @@ test_expect_success 'status: (continue first edit) second edit and split' '
git rebase -i HEAD~3 &&
git rebase --continue &&
git reset HEAD^ &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (Once your working directory is clean, run "git rebase --continue")
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: main.txt
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(Once your working directory is clean, run "git rebase --continue")
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -329,12 +325,12 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
git rebase -i HEAD~3 &&
git rebase --continue &&
git commit --amend -m "foo" &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (use "git commit --amend" to amend the current commit)
# (use "git rebase --continue" once you are satisfied with your changes)
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -351,12 +347,12 @@ test_expect_success 'status: (amend first edit) second edit' '
git rebase -i HEAD~3 &&
git commit --amend -m "a" &&
git rebase --continue &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (use "git commit --amend" to amend the current commit)
# (use "git rebase --continue" once you are satisfied with your changes)
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -374,17 +370,17 @@ test_expect_success 'status: (amend first edit) second edit and split' '
git commit --amend -m "b" &&
git rebase --continue &&
git reset HEAD^ &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (Once your working directory is clean, run "git rebase --continue")
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: main.txt
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(Once your working directory is clean, run "git rebase --continue")
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -402,12 +398,12 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
git commit --amend -m "c" &&
git rebase --continue &&
git commit --amend -m "d" &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (use "git commit --amend" to amend the current commit)
# (use "git rebase --continue" once you are satisfied with your changes)
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -426,12 +422,12 @@ test_expect_success 'status: (split first edit) second edit' '
git add main.txt &&
git commit -m "e" &&
git rebase --continue &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (use "git commit --amend" to amend the current commit)
# (use "git rebase --continue" once you are satisfied with your changes)
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -451,17 +447,17 @@ test_expect_success 'status: (split first edit) second edit and split' '
git commit --amend -m "f" &&
git rebase --continue &&
git reset HEAD^ &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (Once your working directory is clean, run "git rebase --continue")
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: main.txt
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(Once your working directory is clean, run "git rebase --continue")
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -481,12 +477,12 @@ test_expect_success 'status: (split first edit) second edit and amend' '
git commit --amend -m "g" &&
git rebase --continue &&
git commit --amend -m "h" &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
# (use "git commit --amend" to amend the current commit)
# (use "git rebase --continue" once you are satisfied with your changes)
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -508,13 +504,13 @@ test_expect_success 'status in an am session: file already exists' '
test_when_finished "rm Maildir/* && git am --abort" &&
git format-patch -1 -oMaildir &&
test_must_fail git am Maildir/*.patch &&
cat >expected <<-\EOF &&
# On branch am_already_exists
# You are in the middle of an am session.
# (fix conflicts and then run "git am --continue")
# (use "git am --skip" to skip this patch)
# (use "git am --abort" to restore the original branch)
#
cat >expected <<\EOF &&
On branch am_already_exists
You are in the middle of an am session.
(fix conflicts and then run "git am --continue")
(use "git am --skip" to skip this patch)
(use "git am --abort" to restore the original branch)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -530,13 +526,13 @@ test_expect_success 'status in an am session: file does not exist' '
test_when_finished "rm Maildir/* && git am --abort" &&
git format-patch -1 -oMaildir &&
test_must_fail git am Maildir/*.patch &&
cat >expected <<-\EOF &&
# On branch am_not_exists
# You are in the middle of an am session.
# (fix conflicts and then run "git am --continue")
# (use "git am --skip" to skip this patch)
# (use "git am --abort" to restore the original branch)
#
cat >expected <<\EOF &&
On branch am_not_exists
You are in the middle of an am session.
(fix conflicts and then run "git am --continue")
(use "git am --skip" to skip this patch)
(use "git am --abort" to restore the original branch)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -553,13 +549,13 @@ test_expect_success 'status in an am session: empty patch' '
git commit -m "delete all am_empty" &&
echo error >Maildir/0002-two_am.patch &&
test_must_fail git am Maildir/*.patch &&
cat >expected <<-\EOF &&
# On branch am_empty
# You are in the middle of an am session.
# The current patch is empty.
# (use "git am --skip" to skip this patch)
# (use "git am --abort" to restore the original branch)
#
cat >expected <<\EOF &&
On branch am_empty
You are in the middle of an am session.
The current patch is empty.
(use "git am --skip" to skip this patch)
(use "git am --abort" to restore the original branch)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -578,11 +574,11 @@ test_expect_success 'status when bisecting' '
git bisect bad &&
git bisect good one_bisect &&
TGT=$(git rev-parse --short two_bisect) &&
cat >expected <<-EOF &&
# HEAD detached at $TGT
# You are currently bisecting, started from branch '\''bisect'\''.
# (use "git bisect reset" to get back to the original branch)
#
cat >expected <<EOF &&
HEAD detached at $TGT
You are currently bisecting, started from branch '\''bisect'\''.
(use "git bisect reset" to get back to the original branch)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -601,13 +597,13 @@ test_expect_success 'status when rebase conflicts with statushints disabled' '
test_when_finished "git rebase --abort" &&
ONTO=$(git rev-parse --short HEAD^^) &&
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
cat >expected <<-EOF &&
# rebase in progress; onto $ONTO
# You are currently rebasing branch '\''statushints_disabled'\'' on '\''$ONTO'\''.
#
# Unmerged paths:
# both modified: main.txt
#
cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently rebasing branch '\''statushints_disabled'\'' on '\''$ONTO'\''.
Unmerged paths:
both modified: main.txt
no changes added to commit
EOF
git status --untracked-files=no >actual &&
@ -630,17 +626,17 @@ test_expect_success 'prepare for cherry-pick conflicts' '
test_expect_success 'status when cherry-picking before resolving conflicts' '
test_when_finished "git cherry-pick --abort" &&
test_must_fail git cherry-pick cherry_branch_second &&
cat >expected <<-\EOF &&
# On branch cherry_branch
# You are currently cherry-picking.
# (fix conflicts and run "git cherry-pick --continue")
# (use "git cherry-pick --abort" to cancel the cherry-pick operation)
#
# Unmerged paths:
# (use "git add <file>..." to mark resolution)
#
# both modified: main.txt
#
cat >expected <<\EOF &&
On branch cherry_branch
You are currently cherry-picking.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: main.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -654,17 +650,17 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
test_must_fail git cherry-pick cherry_branch_second &&
echo end >main.txt &&
git add main.txt &&
cat >expected <<-\EOF &&
# On branch cherry_branch
# You are currently cherry-picking.
# (all conflicts fixed: run "git cherry-pick --continue")
# (use "git cherry-pick --abort" to cancel the cherry-pick operation)
#
# Changes to be committed:
#
# modified: main.txt
#
# Untracked files not listed (use -u option to show untracked files)
cat >expected <<\EOF &&
On branch cherry_branch
You are currently cherry-picking.
(all conflicts fixed: run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: main.txt
Untracked files not listed (use -u option to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
@ -673,16 +669,16 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
test_expect_success 'status showing detached at and from a tag' '
test_commit atag tagging &&
git checkout atag &&
cat >expected <<-\EOF
# HEAD detached at atag
cat >expected <<\EOF
HEAD detached at atag
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual &&
git reset --hard HEAD^ &&
cat >expected <<-\EOF
# HEAD detached from atag
cat >expected <<\EOF
HEAD detached from atag
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
@ -699,18 +695,18 @@ test_expect_success 'status while reverting commit (conflicts)' '
test_commit new to-revert.txt &&
TO_REVERT=$(git rev-parse --short HEAD^) &&
test_must_fail git revert $TO_REVERT &&
cat >expected <<-EOF
# On branch master
# You are currently reverting commit $TO_REVERT.
# (fix conflicts and run "git revert --continue")
# (use "git revert --abort" to cancel the revert operation)
#
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add <file>..." to mark resolution)
#
# both modified: to-revert.txt
#
cat >expected <<EOF
On branch master
You are currently reverting commit $TO_REVERT.
(fix conflicts and run "git revert --continue")
(use "git revert --abort" to cancel the revert operation)
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: to-revert.txt
no changes added to commit (use "git add" and/or "git commit -a")
EOF
git status --untracked-files=no >actual &&
@ -720,18 +716,18 @@ test_expect_success 'status while reverting commit (conflicts)' '
test_expect_success 'status while reverting commit (conflicts resolved)' '
echo reverted >to-revert.txt &&
git add to-revert.txt &&
cat >expected <<-EOF
# On branch master
# You are currently reverting commit $TO_REVERT.
# (all conflicts fixed: run "git revert --continue")
# (use "git revert --abort" to cancel the revert operation)
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: to-revert.txt
#
# Untracked files not listed (use -u option to show untracked files)
cat >expected <<EOF
On branch master
You are currently reverting commit $TO_REVERT.
(all conflicts fixed: run "git revert --continue")
(use "git revert --abort" to cancel the revert operation)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: to-revert.txt
Untracked files not listed (use -u option to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
@ -739,8 +735,8 @@ test_expect_success 'status while reverting commit (conflicts resolved)' '
test_expect_success 'status after reverting commit' '
git revert --continue &&
cat >expected <<-\EOF
# On branch master
cat >expected <<\EOF
On branch master
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&