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

Function reject_entry

archive.c:402–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400};
401
402static int reject_entry(const struct object_id *oid UNUSED,
403 struct strbuf *base,
404 const char *filename, unsigned mode,
405 void *context)
406{
407 int ret = -1;
408 struct path_exists_context *ctx = context;
409
410 if (S_ISDIR(mode)) {
411 struct strbuf sb = STRBUF_INIT;
412 strbuf_addbuf(&sb, base);
413 strbuf_addstr(&sb, filename);
414 if (!match_pathspec(ctx->args->repo->index,
415 &ctx->pathspec,
416 sb.buf, sb.len, 0, NULL, 1))
417 ret = READ_TREE_RECURSIVE;
418 strbuf_release(&sb);
419 }
420 return ret;
421}
422
423static int reject_outside(const struct object_id *oid UNUSED,
424 struct strbuf *base, const char *filename,

Callers

nothing calls this directly

Calls 4

strbuf_addbufFunction · 0.85
strbuf_addstrFunction · 0.85
match_pathspecFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected