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

Function search_for_subdir

refs/ref-cache.c:158–169  ·  view source on GitHub ↗

* Search for a directory entry directly within dir (without * recursing). Sort dir if necessary. subdirname must be a directory * name (i.e., end in '/'). Returns NULL if the desired * directory cannot be found. dir must already be complete. */

Source from the content-addressed store, hash-verified

156 * directory cannot be found. dir must already be complete.
157 */
158static struct ref_dir *search_for_subdir(struct ref_dir *dir,
159 const char *subdirname, size_t len)
160{
161 int entry_index = search_ref_dir(dir, subdirname, len);
162 struct ref_entry *entry;
163
164 if (entry_index == -1)
165 return NULL;
166
167 entry = dir->entries[entry_index];
168 return get_ref_dir(entry);
169}
170
171/*
172 * If refname is a reference name, find the ref_dir within the dir

Callers 1

find_containing_dirFunction · 0.85

Calls 2

search_ref_dirFunction · 0.85
get_ref_dirFunction · 0.85

Tested by

no test coverage detected