MCPcopy Create free account
hub / github.com/git/git / match_dir_prefix

Function match_dir_prefix

tree-walk.c:947–965  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

945}
946
947static int match_dir_prefix(const struct pathspec_item *item,
948 const char *base,
949 const char *match, int matchlen)
950{
951 if (basecmp(item, base, match, matchlen))
952 return 0;
953
954 /*
955 * If the base is a subdirectory of a path which
956 * was specified, all of them are interesting.
957 */
958 if (!matchlen ||
959 base[matchlen] == '/' ||
960 match[matchlen - 1] == '/')
961 return 1;
962
963 /* Just a random prefix match */
964 return 0;
965}
966
967/*
968 * Perform matching on the leading non-wildcard part of

Callers 1

do_matchFunction · 0.85

Calls 1

basecmpFunction · 0.85

Tested by

no test coverage detected