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

Function within_depth

dir.c:296–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296int within_depth(const char *name, int namelen,
297 int depth, int max_depth)
298{
299 const char *cp = name, *cpe = name + namelen;
300
301 while (cp < cpe) {
302 if (*cp++ != '/')
303 continue;
304 depth++;
305 if (depth > max_depth)
306 return 0;
307 }
308 return depth <= max_depth;
309}
310
311/*
312 * Read the contents of the blob with the given OID into a buffer.

Callers 3

check_recursion_depthFunction · 0.85
do_matchFunction · 0.85
do_match_pathspecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected