diff options
author | Tao Klerks <tao@klerks.biz> | 2022-02-27 21:57:01 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-28 10:02:18 -0800 |
commit | 317956d91239e86b26ce95735451698b042dbe5d (patch) | |
tree | 7b39150e3ff1f3d558ce1507c1a065c43d8a5aa5 /t/t0041-usage.sh | |
parent | t7519: populate untracked cache before test (diff) | |
download | tgif-317956d91239e86b26ce95735451698b042dbe5d.tar.xz |
untracked-cache: write index when populating empty untracked cache
It is expected that an empty/unpopulated untracked cache structure can
be written to the index - by update-index, or by a "git status" call
that sees the untracked cache should be enabled and is not, but is
running with options that make the untracked cache non-applicable in
that run (eg a pathspec).
Currently, if that happens, then subsequent "git status" calls end up
populating the untracked cache, but not writing the index (not saving
their work) - so the performance outcome is almost identical to the
cache being altogether disabled.
This continues until the index gets written with the untracked cache
populated, for some *other* reason, such as a working tree change.
Detect the condition where an empty untracked cache exists in the
index and we will collect the list of untracked paths, and queue an
index write under that condition, so that the collected untracked
paths can be written out to the untracked cache extension in the
index.
This change depends on previous fixes to t7519 for the "ignore .git
changes when invalidating UNTR" test case to pass - before this fix,
the test never actually did anything as it was not set up correctly.
Signed-off-by: Tao Klerks <tao@klerks.biz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0041-usage.sh')
0 files changed, 0 insertions, 0 deletions