Skip to content

Commit 3b65c24

Browse files
committed
Merge branch 'jk/prune-mtime' into maint
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
2 parents 49e863b + 094c7e6 commit 3b65c24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sha1_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3507,12 +3507,12 @@ static int for_each_file_in_obj_subdir(int subdir_nr,
35073507
break;
35083508
}
35093509
}
3510-
strbuf_setlen(path, baselen);
3510+
closedir(dir);
35113511

3512+
strbuf_setlen(path, baselen);
35123513
if (!r && subdir_cb)
35133514
r = subdir_cb(subdir_nr, path->buf, data);
35143515

3515-
closedir(dir);
35163516
return r;
35173517
}
35183518

0 commit comments

Comments
 (0)