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

Function dir_iterator_free

dir-iterator.c:243–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243void dir_iterator_free(struct dir_iterator *dir_iterator)
244{
245 struct dir_iterator_int *iter = (struct dir_iterator_int *)dir_iterator;
246
247 if (!iter)
248 return;
249
250 for (; iter->levels_nr; iter->levels_nr--) {
251 struct dir_iterator_level *level =
252 &iter->levels[iter->levels_nr - 1];
253
254 if (level->dir && closedir(level->dir)) {
255 int saved_errno = errno;
256 strbuf_setlen(&iter->base.path, level->prefix_len);
257 errno = saved_errno;
258 warning_errno("error closing directory '%s'",
259 iter->base.path.buf);
260 }
261
262 string_list_clear(&level->entries, 0);
263 }
264
265 free(iter->levels);
266 strbuf_release(&iter->base.path);
267 free(iter);
268}
269
270struct dir_iterator *dir_iterator_begin(const char *path, unsigned int flags)
271{

Callers 5

dir_iterator_beginFunction · 0.85
cmd__dir_iteratorFunction · 0.85
files_fsck_refs_dirFunction · 0.85
copy_or_link_directoryFunction · 0.85

Calls 5

closedirFunction · 0.85
strbuf_setlenFunction · 0.85
warning_errnoFunction · 0.85
string_list_clearFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by 1

cmd__dir_iteratorFunction · 0.68