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

Function open_cached_dir

dir.c:2571–2595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2569}
2570
2571static int open_cached_dir(struct cached_dir *cdir,
2572 struct dir_struct *dir,
2573 struct untracked_cache_dir *untracked,
2574 struct index_state *istate,
2575 struct strbuf *path,
2576 int check_only)
2577{
2578 const char *c_path;
2579
2580 memset(cdir, 0, sizeof(*cdir));
2581 cdir->untracked = untracked;
2582 if (valid_cached_dir(dir, untracked, istate, path, check_only))
2583 return 0;
2584 c_path = path->len ? path->buf : ".";
2585 cdir->fdir = opendir(c_path);
2586 if (!cdir->fdir)
2587 warning_errno(_("could not open directory '%s'"), c_path);
2588 if (dir->untracked) {
2589 invalidate_directory(dir->untracked, untracked);
2590 dir->untracked->dir_opened++;
2591 }
2592 if (!cdir->fdir)
2593 return -1;
2594 return 0;
2595}
2596
2597static int read_cached_dir(struct cached_dir *cdir)
2598{

Callers 1

read_directory_recursiveFunction · 0.85

Calls 4

valid_cached_dirFunction · 0.85
opendirFunction · 0.85
warning_errnoFunction · 0.85
invalidate_directoryFunction · 0.85

Tested by

no test coverage detected