diff options
Diffstat (limited to 't/t7519-status-fsmonitor.sh')
-rwxr-xr-x | t/t7519-status-fsmonitor.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh index 81a375fa0f..997d5fb349 100755 --- a/t/t7519-status-fsmonitor.sh +++ b/t/t7519-status-fsmonitor.sh @@ -354,4 +354,23 @@ test_expect_success 'discard_index() also discards fsmonitor info' ' test_cmp expect actual ' +# Test unstaging entries that: +# - Are not flagged with CE_FSMONITOR_VALID +# - Have a position in the index >= the number of entries present in the index +# after unstaging. +test_expect_success 'status succeeds after staging/unstaging' ' + test_create_repo fsmonitor-stage-unstage && + ( + cd fsmonitor-stage-unstage && + test_commit initial && + git update-index --fsmonitor && + removed=$(test_seq 1 100 | sed "s/^/z/") && + touch $removed && + git add $removed && + git config core.fsmonitor "$TEST_DIRECTORY/t7519/fsmonitor-env" && + FSMONITOR_LIST="$removed" git restore -S $removed && + FSMONITOR_LIST="$removed" git status + ) +' + test_done |