* 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. */
| 156 | * directory cannot be found. dir must already be complete. |
| 157 | */ |
| 158 | static 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 |
no test coverage detected