diff options
author | Jeff King <peff@peff.net> | 2008-02-12 08:45:18 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-14 00:54:58 +0300 |
commit | ff58b9aaf8bf4ce7471a21baa502cb9ddaa9873a (patch) | |
tree | f4469b2de8595c87f687a151ab75e1e615666499 /t/t7502-status.sh | |
parent | 077b725f0bbe2b6ca2deb569c22a6f0d7a374dd3 (diff) |
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.
wt_status_print_cached_header was updated to take the whole
wt_status struct rather than just the reference field.
Previously the various code paths were sometimes sending in
s->reference and sometimes sending in NULL, making the
decision on whether this was an initial commit before we
even got to this function. Now we must check the initial
flag here.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7502-status.sh')
-rwxr-xr-x | 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 9ce50cade8..b64ce30ff1 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 |