Skip to content

Commit 897b185

Browse files
committed
Merge branch 'jk/prune-mtime'
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 4b9ab0e + 094c7e6 commit 897b185

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
@@ -3504,12 +3504,12 @@ static int for_each_file_in_obj_subdir(int subdir_nr,
35043504
break;
35053505
}
35063506
}
3507-
strbuf_setlen(path, baselen);
3507+
closedir(dir);
35083508

3509+
strbuf_setlen(path, baselen);
35093510
if (!r && subdir_cb)
35103511
r = subdir_cb(subdir_nr, path->buf, data);
35113512

3512-
closedir(dir);
35133513
return r;
35143514
}
35153515

0 commit comments

Comments
 (0)