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

Function check_path

entry.c:428–439  ·  view source on GitHub ↗

* This is like 'lstat()', except it refuses to follow symlinks * in the path, after skipping "skiplen". */

Source from the content-addressed store, hash-verified

426 * in the path, after skipping "skiplen".
427 */
428static int check_path(const char *path, int len, struct stat *st, int skiplen)
429{
430 const char *slash = path + len;
431
432 while (path < slash && *slash != '/')
433 slash--;
434 if (!has_dirs_only_path(path, slash - path, skiplen)) {
435 errno = ENOENT;
436 return -1;
437 }
438 return lstat(path, st);
439}
440
441static void mark_colliding_entries(const struct checkout *state,
442 struct cache_entry *ce, struct stat *st)

Callers 1

checkout_entry_caFunction · 0.85

Calls 1

has_dirs_only_pathFunction · 0.85

Tested by

no test coverage detected