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

Function overlaps_prefix

refs/ref-cache.c:264–277  ·  view source on GitHub ↗

* Return a `prefix_state` constant describing the relationship * between the directory with the specified `dirname` and `prefix`. */

Source from the content-addressed store, hash-verified

262 * between the directory with the specified `dirname` and `prefix`.
263 */
264static enum prefix_state overlaps_prefix(const char *dirname,
265 const char *prefix)
266{
267 while (*prefix && *dirname == *prefix) {
268 dirname++;
269 prefix++;
270 }
271 if (!*prefix)
272 return PREFIX_CONTAINS_DIR;
273 else if (!*dirname)
274 return PREFIX_WITHIN_DIR;
275 else
276 return PREFIX_EXCLUDES_DIR;
277}
278
279/*
280 * Load all of the refs from `dir` (recursively) that could possibly

Callers 2

prime_ref_dirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected