summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-12-15 16:02:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-12-15 16:02:16 (GMT)
commit897b18508b5c57f94730d862ad6620d56cd1d856 (patch)
tree2e9373951aa1fb5825acf8606bfcfdaeed087a20
parent4b9ab0ee0130090c63da2df83747b7b1d834ad98 (diff)
parent094c7e635287e999f382681b0749ce7711e5ce7d (diff)
downloadgit-897b18508b5c57f94730d862ad6620d56cd1d856.zip
git-897b18508b5c57f94730d862ad6620d56cd1d856.tar.gz
git-897b18508b5c57f94730d862ad6620d56cd1d856.tar.bz2
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
-rw-r--r--sha1_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 27ce7b7..2c68766 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -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;
}