diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-09 13:38:23 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-09 13:38:23 -0800 |
commit | 82386b44963f127d6dbe25d48889bde3149e177c (patch) | |
tree | 56659c554f71478bd7ab0635fc23438faa760f91 /repository.c | |
parent | The ninth batch (diff) | |
parent | repo_read_index: add config to expect files outside sparse patterns (diff) | |
download | tgif-82386b44963f127d6dbe25d48889bde3149e177c.tar.xz |
Merge branch 'en/present-despite-skipped'
In sparse-checkouts, files mis-marked as missing from the working tree
could lead to later problems. Such files were hard to discover, and
harder to correct. Automatically detecting and correcting the marking
of such files has been added to avoid these problems.
* en/present-despite-skipped:
repo_read_index: add config to expect files outside sparse patterns
Accelerate clear_skip_worktree_from_present_files() by caching
Update documentation related to sparsity and the skip-worktree bit
repo_read_index: clear SKIP_WORKTREE bit from files present in worktree
unpack-trees: fix accidental loss of user changes
t1011: add testcase demonstrating accidental loss of user modifications
Diffstat (limited to 'repository.c')
-rw-r--r-- | repository.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/repository.c b/repository.c index 34610c5a33..dddee32258 100644 --- a/repository.c +++ b/repository.c @@ -301,6 +301,13 @@ int repo_read_index(struct repository *repo) if (repo->settings.command_requires_full_index) ensure_full_index(repo->index); + /* + * If sparse checkouts are in use, check whether paths with the + * SKIP_WORKTREE attribute are missing from the worktree; if not, + * clear that attribute for that path. + */ + clear_skip_worktree_from_present_files(repo->index); + return res; } |