The helper used to iterate over loose object directories to prune
stale objects did not closedir() immediately when it is done with a
directory--a callback such as the one used for "git prune" may want
to do rmdir(), but it would fail on open directory on platforms
such as WinXP.

* jk/prune-mtime:
  prune: close directory earlier during loose-object directory traversal
This commit is contained in:
Junio C Hamano 2015-12-15 08:02:13 -08:00
Родитель 4b9ab0ee01 094c7e6352
Коммит 897b18508b
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -3504,12 +3504,12 @@ static int for_each_file_in_obj_subdir(int subdir_nr,
break;
}
}
strbuf_setlen(path, baselen);
closedir(dir);
strbuf_setlen(path, baselen);
if (!r && subdir_cb)
r = subdir_cb(subdir_nr, path->buf, data);
closedir(dir);
return r;
}