forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unpack-trees: handle missing sparse directories
If a sparse directory does not exist in the index, unpack it at the directory level rather than recursing into it an unpacking its contents file-by-file. This helps keep the sparse index as collapsed as possible in cases such as 'git reset --hard' restoring a sparse directory. A directory is determined to be truly non-existent in the index (rather than the parent of existing index entries), if 1) its path is outside the sparse cone and 2) there are no children of the directory in the index. This check is performed by 'missing_dir_is_sparse()' in 'unpack_single_entry()'. If the directory is a missing sparse dir, 'unpack_single_entry()' will proceed with unpacking it. This determination is also propagated back up to 'unpack_callback()' via 'is_missing_sparse_dir' to prevent further tree traversal into the unpacked directory. Reported-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> Signed-off-by: Victoria Dye <vdye@github.com>
- Loading branch information
Showing
2 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters