Re: [Bug] git-status shows bad instructions prior to first commit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 13, 2008, 22:02 UTC
- Message-ID
- <7vodako6qb.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080212054518.GA24817@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> 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