MCPcopy Index your code
hub / github.com/git/git / path_exists

Function path_exists

archive.c:444–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444static int path_exists(struct archiver_args *args, const char *path)
445{
446 const char *paths[] = { path, NULL };
447 struct path_exists_context ctx;
448 int ret;
449
450 ctx.args = args;
451 parse_pathspec(&ctx.pathspec, 0, PATHSPEC_PREFER_CWD,
452 args->prefix, paths);
453 ctx.pathspec.recursive = 1;
454 if (args->prefix && read_tree(args->repo, args->tree, &ctx.pathspec,
455 reject_outside, args))
456 die(_("pathspec '%s' matches files outside the "
457 "current directory"), path);
458 ret = read_tree(args->repo, args->tree,
459 &ctx.pathspec,
460 reject_entry, &ctx);
461 clear_pathspec(&ctx.pathspec);
462 return ret != 0;
463}
464
465static void parse_pathspec_arg(const char **pathspec,
466 struct archiver_args *ar_args)

Callers 1

parse_pathspec_argFunction · 0.70

Calls 4

parse_pathspecFunction · 0.85
read_treeFunction · 0.85
clear_pathspecFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected