summaryrefslogtreecommitdiff
path: root/t/t7512-status-help.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-01-26 17:08:41 +0100
committerJunio C Hamano <gitster@pobox.com>2017-01-26 11:43:18 -0800
commitdf9ded4984ca9a2d8da9007049f4fb5275eaa3ac (patch)
tree153da5ea5a3a1385485fdd5a1522c04a398c193e /t/t7512-status-help.sh
parentc3808ca6982b0ad7ee9b87eca9b50b9a24ec08b0 (diff)
downloadgit-df9ded4984ca9a2d8da9007049f4fb5275eaa3ac.tar.gz
status: be prepared for not-yet-started interactive rebasejs/status-pre-rebase-i
Some developers might want to call `git status` in a working directory where they just started an interactive rebase, but the edit script is still opened in the editor. Let's show a meaningful message in such cases. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7512-status-help.sh')
-rwxr-xr-xt/t7512-status-help.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 5c3db656df..458608cc1e 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -944,4 +944,23 @@ EOF
test_i18ncmp expected actual
'
+test_expect_success 'status: handle not-yet-started rebase -i gracefully' '
+ ONTO=$(git rev-parse --short HEAD^) &&
+ COMMIT=$(git rev-parse --short HEAD) &&
+ EDITOR="git status --untracked-files=no >actual" git rebase -i HEAD^ &&
+ cat >expected <<EOF &&
+On branch several_commits
+No commands done.
+Next command to do (1 remaining command):
+ pick $COMMIT four_commit
+ (use "git rebase --edit-todo" to view and edit)
+You are currently editing a commit while rebasing branch '\''several_commits'\'' 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
+ test_i18ncmp expected actual
+'
+
test_done