Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index 3b37022720..f2b0f24210 100644
--- a/dir.c
+++ b/dir.c
@@ -1463,10 +1463,11 @@ static int path_in_sparse_checkout_1(const char *path,
const char *end, *slash;
/*
- * We default to accepting a path if there are no patterns or
- * they are of the wrong type.
+ * We default to accepting a path if the path is empty, there are no
+ * patterns, or the patterns are of the wrong type.
*/
- if (init_sparse_checkout_patterns(istate) ||
+ if (!*path ||
+ init_sparse_checkout_patterns(istate) ||
(require_cone_mode &&
!istate->sparse_checkout_patterns->use_cone_patterns))
return 1;