]> git.ipfire.org Git - thirdparty/git.git/blobdiff - dir.c
Merge branch 'ab/pager-exit-log'
[thirdparty/git.git] / dir.c
diff --git a/dir.c b/dir.c
index d637461da5cb9a03f86fe06d7524b756045755ac..d153a63bbd14e1ee197602368717fb2ca42c4e72 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -2998,6 +2998,23 @@ void setup_standard_excludes(struct dir_struct *dir)
        }
 }
 
+char *get_sparse_checkout_filename(void)
+{
+       return git_pathdup("info/sparse-checkout");
+}
+
+int get_sparse_checkout_patterns(struct pattern_list *pl)
+{
+       int res;
+       char *sparse_filename = get_sparse_checkout_filename();
+
+       pl->use_cone_patterns = core_sparse_checkout_cone;
+       res = add_patterns_from_file_to_list(sparse_filename, "", 0, pl, NULL);
+
+       free(sparse_filename);
+       return res;
+}
+
 int remove_path(const char *name)
 {
        char *slash;