diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-07-08 21:23:07 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-08 21:23:07 +0300 |
commit | 7f5ad0ca8d1d7db7a21755af34251714d86b2ec1 (patch) | |
tree | 8b71767227de1c77adf50c36cc9f0d567046c9ba /t | |
parent | d52a45cf5635f9f40a99ddc6efa92713f2d357b4 (diff) | |
parent | 2ee045eea103e8818ffe0c4085fad3f6b535c8d6 (diff) |
Merge branch 'js/empty-index-fixes'
A few places failed to differenciate the case where the index is
truly empty (nothing added) and we haven't yet read from the
on-disk index file, which have been corrected.
* js/empty-index-fixes:
commit -a -m: allow the top-level tree to become empty again
split-index: accept that a base index can be empty
do_read_index(): always mark index as initialized unless erroring out
Diffstat (limited to 't')
-rwxr-xr-x | t/t2200-add-update.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh index be394f1131..c01492f33f 100755 --- a/t/t2200-add-update.sh +++ b/t/t2200-add-update.sh @@ -197,4 +197,15 @@ test_expect_success '"add -u non-existent" should fail' ' ! grep "non-existent" actual ' +test_expect_success '"commit -a" implies "add -u" if index becomes empty' ' + git rm -rf \* && + git commit -m clean-slate && + test_commit file1 && + rm file1.t && + test_tick && + git commit -a -m remove && + git ls-tree HEAD: >out && + test_must_be_empty out +' + test_done |