Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2013-09-06 21:43:08 +0400
committerJunio C Hamano <gitster@pobox.com>2013-09-07 00:33:18 +0400
commit1c7969c933c08a1a9d5b6fcd728ed95930b5b5ef (patch)
tree11e2785ae22401926dcd973c00830d31ebf49ed1 /t/t7512-status-help.sh
parent2556b9962e7c0353d562b7bf70eed11d8f29d0b0 (diff)
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>
Diffstat (limited to 't/t7512-status-help.sh')
-rwxr-xr-xt/t7512-status-help.sh604
1 files changed, 300 insertions, 304 deletions
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 312f41765f..0688d58884 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -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,18 +25,18 @@ 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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
test_i18ncmp expected actual
'
@@ -51,17 +47,17 @@ 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)
- EOF
+ 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,21 +76,21 @@ 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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
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^^ &&
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)
- EOF
+ 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,21 +135,21 @@ 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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
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) &&
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)
- EOF
+ 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,14 +189,14 @@ 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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
test_i18ncmp expected actual
'
@@ -219,19 +215,19 @@ 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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
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) &&
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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
test_i18ncmp expected actual
'
@@ -280,14 +276,14 @@ 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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
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 --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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
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 --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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
test_i18ncmp expected actual
'
@@ -351,14 +347,14 @@ 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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
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 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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
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 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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
test_i18ncmp expected actual
'
@@ -426,14 +422,14 @@ 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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
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 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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
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 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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
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" &&
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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
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" &&
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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
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" &&
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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
test_i18ncmp expected actual
'
@@ -578,13 +574,13 @@ 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)
- #
- nothing to commit (use -u to show untracked files)
- EOF
+ 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 &&
test_i18ncmp expected actual
'
@@ -601,15 +597,15 @@ 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
- #
- no changes added to commit
- EOF
+ 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 &&
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_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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
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 &&
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)
- EOF
+ 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,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_commit atag tagging &&
git checkout atag &&
- cat >expected <<-\EOF
- # HEAD detached at atag
- nothing to commit (use -u to show untracked files)
- EOF
+ 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
- nothing to commit (use -u to show untracked files)
- EOF
+ cat >expected <<\EOF
+HEAD detached from atag
+nothing to commit (use -u to show untracked files)
+EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
'
@@ -699,20 +695,20 @@ 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
- #
- no changes added to commit (use "git add" and/or "git commit -a")
- EOF
+ 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 &&
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)' '
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)
- EOF
+ 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
'
test_expect_success 'status after reverting commit' '
git revert --continue &&
- cat >expected <<-\EOF
- # On branch master
- nothing to commit (use -u to show untracked files)
- EOF
+ cat >expected <<\EOF
+On branch master
+nothing to commit (use -u to show untracked files)
+EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
'