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

File diff suppressed because it is too large Load Diff

View File

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