summaryrefslogtreecommitdiff
path: root/t/t7508-status.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-06-30 20:45:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-30 20:45:22 (GMT)
commit7e46f19a105f3798b03ac3887f45034fbfdff676 (patch)
treef258b34d49b1e01d41e6de033e091335359cb9a8 /t/t7508-status.sh
parentc7ee0baae7e874898032ab0c63600951eb7c2d18 (diff)
parent4ddb1354e8d5daf5671d3d451a67d2d1e82d9b49 (diff)
downloadgit-7e46f19a105f3798b03ac3887f45034fbfdff676.zip
git-7e46f19a105f3798b03ac3887f45034fbfdff676.tar.gz
git-7e46f19a105f3798b03ac3887f45034fbfdff676.tar.bz2
Merge branch 'ks/status-initial-commit'
"git status" has long shown essentially the same message as "git commit"; the message it gives while preparing for the root commit, i.e. "Initial commit", was hard to understand for some new users. Now it says "No commits yet" to stress more on the current status (rather than the commit the user is preparing for, which is more in line with the focus of "git commit"). * ks/status-initial-commit: status: contextually notify user about an initial commit
Diffstat (limited to 't/t7508-status.sh')
-rwxr-xr-xt/t7508-status.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index f7fe22a..43d19a9 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1640,4 +1640,34 @@ test_expect_success 'no additionnal info if no stash entries' '
test_cmp expected_without_stash actual
'
+test_expect_success '"No commits yet" should be noted in status output' '
+ git checkout --orphan empty-branch-1 &&
+ git status >output &&
+ test_i18ngrep "No commits yet" output
+'
+
+test_expect_success '"No commits yet" should not be noted in status output' '
+ git checkout --orphan empty-branch-2 &&
+ test_commit test-commit-1 &&
+ git status >output &&
+ test_i18ngrep ! "No commits yet" output
+'
+
+test_expect_success '"Initial commit" should be noted in commit template' '
+ git checkout --orphan empty-branch-3 &&
+ touch to_be_committed_1 &&
+ git add to_be_committed_1 &&
+ git commit --dry-run >output &&
+ test_i18ngrep "Initial commit" output
+'
+
+test_expect_success '"Initial commit" should not be noted in commit template' '
+ git checkout --orphan empty-branch-4 &&
+ test_commit test-commit-2 &&
+ touch to_be_committed_2 &&
+ git add to_be_committed_2 &&
+ git commit --dry-run >output &&
+ test_i18ngrep ! "Initial commit" output
+'
+
test_done