diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-09-09 21:02:25 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-09-09 21:02:26 +0200 |
commit | fe3939bc2a91ec126313392cabc5777030d14d7b (patch) | |
tree | c8f2a80c2d1e0aaa299710b541c190780bd66b47 /unpack-trees.c | |
parent | Merge branch 'ab/retire-ppc-sha1' (diff) | |
parent | unpack-trees: fix sparse directory recursion check (diff) | |
download | git-fe3939bc2a91ec126313392cabc5777030d14d7b.tar.xz git-fe3939bc2a91ec126313392cabc5777030d14d7b.zip |
Merge branch 'vd/sparse-reset-checkout-fixes'
Segfault fix-up to an earlier fix to the topic to teach "git reset"
and "git checkout" work better in a sparse checkout.
* vd/sparse-reset-checkout-fixes:
unpack-trees: fix sparse directory recursion check
Diffstat (limited to 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index 90b92114be..bae812156c 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1423,7 +1423,7 @@ static void debug_unpack_callback(int n, * from the tree walk at the given traverse_info. */ static int is_sparse_directory_entry(struct cache_entry *ce, - struct name_entry *name, + const struct name_entry *name, struct traverse_info *info) { if (!ce || !name || !S_ISSPARSEDIR(ce->ce_mode)) @@ -1562,7 +1562,7 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str } } - if (!is_sparse_directory_entry(src[0], names, info) && + if (!is_sparse_directory_entry(src[0], p, info) && !is_new_sparse_dir && traverse_trees_recursive(n, dirmask, mask & ~dirmask, names, info) < 0) { |