X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=dir.c;h=d153a63bbd14e1ee197602368717fb2ca42c4e72;hb=dcb11fc6225edbe2bd7af63eb550b739e7f4a074;hp=d637461da5cb9a03f86fe06d7524b756045755ac;hpb=b65b9ff1ff8a809246cc6bd8ad9051b28e5bf330;p=thirdparty%2Fgit.git diff --git a/dir.c b/dir.c index d637461da5..d153a63bbd 100644 --- 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;