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

Function threaded_has_dirs_only_path

symlinks.c:268–280  ·  view source on GitHub ↗

* Return non-zero if all path components of 'name' exists as a * directory. If prefix_len > 0, we will test with the stat() * function instead of the lstat() function for a prefix length of * 'prefix_len', thus we then allow for symlinks in the prefix part as * long as those points to real existing directories. */

Source from the content-addressed store, hash-verified

266 * long as those points to real existing directories.
267 */
268static int threaded_has_dirs_only_path(struct cache_def *cache, const char *name, int len, int prefix_len)
269{
270 /*
271 * Note: this function is used by the checkout machinery, which also
272 * takes care to properly reset the cache when it performs an operation
273 * that would leave the cache outdated. If this function starts caching
274 * anything else besides FL_DIR, remember to also invalidate the cache
275 * when creating or deleting paths that might be in the cache.
276 */
277 return lstat_cache(cache, name, len,
278 FL_DIR|FL_FULLPATH, prefix_len) &
279 FL_DIR;
280}
281
282static struct strbuf removal = STRBUF_INIT;
283

Callers 1

has_dirs_only_pathFunction · 0.85

Calls 1

lstat_cacheFunction · 0.85

Tested by

no test coverage detected