Skip to content

Commit d8c628d

Browse files
authored
[sparse] fix segault when submodules are present
1 parent 78e8208 commit d8c628d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libgit2/iterator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ int git_iterator_for_tree(
995995
if (git_repository__configmap_lookup(&sparse_checkout_enabled, repo, GIT_CONFIGMAP_SPARSECHECKOUT) < 0)
996996
git_error_clear();
997997

998-
if (sparse_checkout_enabled == true)
998+
if (sparse_checkout_enabled == true && options != NULL)
999999
options->flags |= GIT_ITERATOR_HONOR_SPARSE;
10001000

10011001
if ((error = iterator_init_common(&iter->base,

0 commit comments

Comments
 (0)