Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [Bug] git-status shows bad instructions prior to first commit

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:13
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
status: suggest "git rm --cached" to unstage for initial commit

It makes no sense to suggest "git reset HEAD" since we have
no HEAD commit. This actually used to work but regressed in
f26a0012.
In order to avoid regressing again, we must have something like
this included in your change, which I squashed in.

This goes to 'maint'.  Thanks for the fix.

 t/t7502-status.sh |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/t/t7502-status.sh b/t/t7502-status.sh
index 9ce50ca..b64ce30 100755
--- a/t/t7502-status.sh
+++ b/t/t7502-status.sh
@@ -17,6 +17,9 @@ test_expect_success 'setup' '
 	: > dir1/tracked &&
 	: > dir1/modified &&
 	git add . &&
+
+	git status >output &&
+
 	test_tick &&
 	git commit -m initial &&
 	: > untracked &&
@@ -28,6 +31,12 @@ test_expect_success 'setup' '
 	git add dir2/added
 '
 
+test_expect_success 'status (1)' '
+
+	grep -e "use \"git rm --cached <file>\.\.\.\" to unstage" output
+
+'
+
 cat > expect << \EOF
 # On branch master
 # Changes to be committed:
@@ -51,7 +60,7 @@ cat > expect << \EOF
 #	untracked
 EOF
 
-test_expect_success 'status' '
+test_expect_success 'status (2)' '
 
 	git status > output &&
 	git diff expect output
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help