diff options
author | Jeff King <peff@peff.net> | 2008-02-14 20:18:23 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-16 11:12:56 +0300 |
commit | 959ba670ad7173bcb73afaca69625a5635f63b8b (patch) | |
tree | 655b222daa13108dd01cfce5f444282f7e2f3c8c /t/t7502-status.sh | |
parent | 1fe32cb9d0807e6da468dc7bf96d427b2f38c1c4 (diff) |
commit: discard index after setting up partial commit
There may still be some entries from the original index that
should be discarded before we show the status. In
particular, if a file was added in the index but not
included in the partial commit, it would still show up in
the status listing as staged for commit.
Ultimately the correct fix is to keep the two states in
separate index_state variables. Then we can avoid having
to reload the cache from the temporary file altogether, and
just point wt_status_print at the correct index.
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 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t7502-status.sh b/t/t7502-status.sh index b64ce30ff1..e00607490b 100755 --- a/t/t7502-status.sh +++ b/t/t7502-status.sh @@ -128,4 +128,25 @@ test_expect_success 'status without relative paths' ' ' +cat <<EOF >expect +# On branch master +# Changes to be committed: +# (use "git reset HEAD <file>..." to unstage) +# +# modified: dir1/modified +# +# Untracked files: +# (use "git add <file>..." to include in what will be committed) +# +# dir1/untracked +# dir2/ +# expect +# output +# untracked +EOF +test_expect_success 'status of partial commit excluding new file in index' ' + git status dir1/modified >output && + diff -u expect output +' + test_done |