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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux