summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-12-15 09:27:11 -0800
committerJunio C Hamano <gitster@pobox.com>2015-12-15 09:27:12 -0800
commit3b65c248a384a61501ea0f68a0ef564dcc94c278 (patch)
tree690214acee83d92dedd3cde242cc65ecf690058b
parent49e863b02ae177069ebe6c4bb3d0e14bef7ccf7a (diff)
parent094c7e635287e999f382681b0749ce7711e5ce7d (diff)
downloadgit-3b65c248a384a61501ea0f68a0ef564dcc94c278.tar.gz
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
-rw-r--r--sha1_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 4160e6882d..72289696d9 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -3507,12 +3507,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;
}