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-04-02 18:20:21 +0400
committerJunio C Hamano <gitster@pobox.com>2013-04-03 01:22:55 +0400
commitdb4ef4496e7a99809f7caa52e8821320e5cca7bc (patch)
treec836d1591e398ed5f0cb7874357788404fe58cf1 /t/t7512-status-help.sh
parentcc3e4eba723570bf77902c017611ee02bb86c8b3 (diff)
status: show 'revert' state and status hint
This is the logical equivalent for "git status" of 3ee4452 (bash: teach __git_ps1 about REVERT_HEAD). 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.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 06749a6aa0..d745cf4e5f 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -678,4 +678,61 @@ test_expect_success 'status showing detached from a tag' '
test_i18ncmp expected actual
'
+test_expect_success 'status while reverting commit (conflicts)' '
+ git checkout master &&
+ echo before >to-revert.txt &&
+ test_commit before to-revert.txt &&
+ echo old >to-revert.txt &&
+ test_commit old to-revert.txt &&
+ echo new >to-revert.txt &&
+ test_commit new to-revert.txt &&
+ test_must_fail git revert HEAD^ &&
+ cat >expected <<-EOF
+ # On branch master
+ # You are currently reverting a commit.
+ # (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
+'
+
+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 a commit.
+ # (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
+ git status --untracked-files=no >actual &&
+ test_i18ncmp expected actual
+'
+
test_done