Skip to content

Commit

Permalink
Merge branch 'jk/prune-mtime'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Dec 15, 2015
2 parents 4b9ab0e + 094c7e6 commit 897b185
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 897b185

Please sign in to comment.