diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-07 14:32:03 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-07 14:32:03 -0700 |
commit | e64734b6a0ffabdbf027cfee865a6cae567e2199 (patch) | |
tree | b62fae295b689d82aaf46029328f7f649d193639 /t | |
parent | 88dccb6c989735e2faa24fa78d441a7a1c998b36 (diff) | |
parent | 87e139c0ad32b72ad989fe7d69381f1146250f7a (diff) | |
download | git-e64734b6a0ffabdbf027cfee865a6cae567e2199.tar.gz |
Merge branch 'mm/status-during-revert'
"git status" learned to report that you are in the middle of a
revert session, just like it does for a cherry-pick and a bisect
session.
* mm/status-during-revert:
status: show commit sha1 in "You are currently reverting" message
status: show 'revert' state and status hint
Diffstat (limited to 't')
-rwxr-xr-x | t/t7512-status-help.sh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh index 06749a6aa0..bf08d4e098 100755 --- a/t/t7512-status-help.sh +++ b/t/t7512-status-help.sh @@ -678,4 +678,62 @@ 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 && + 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 + 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 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 + git status --untracked-files=no >actual && + test_i18ncmp expected actual +' + test_done |