Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request git-for-windows#473: Sparse Index: fix a checkout …
…bug with deep sparse-checkout paths We got multiple similar reports of failures with the sparse index (git-for-windows#473 as an issue, and another regarding `git checkout` via email). Both were hitting a similar set of paths, which was a hint. The reason we didn't hit this before is because it requires the following: 1. The sparse-checkout definition needs to have recursive inclusion of deep folders (depth 3 or more). 2. _Adjacent_ to those deep folders, we need a deep sparse directory entry that receives changes. 3. In this particular repo, deep directories are only added to the sparse-checkout in rare occasions and those adjacent folders are rarely updated. They happened to update this week and hit our sparse index dogfooders in surprising ways. The first commit adds a test that fails without the fix. It requires modifying our test data to make adjacent, deep sparse directory entries possible. It's a rather simple test after we have that data change. The second commit includes the actual fix. It's really just an error of not understanding the difference between the `name` and `traverse_path` members of the `struct traverse_info` structure. `name` only stores a single tree entry while `traverse_path` actually includes the full name from root. The method we are editing also has an additional `struct name_entry` that fills in the tree entry on top of the `traverse_path`, which explains how this worked to depth two, but not depth three. Resolves git-for-windows#473 See also gitgitgadget#1092
- Loading branch information