Re: [PATCH] fix deletion of .git/objects sub-directories in git-prune/repack
- From
karsten.blees@dcon.de <karsten.blees@dcon.de>
- Date
- Mar 6, 2012, 21:47 UTC
- Message-ID
- <OF619F6614.68A2AA34-ONC12579B9.00763235-C12579B9.0077B76F@dcon.de>
- In-Reply-To
- <4F565849.80303@kdbg.org>
Johannes Sixt <j6t@kdbg.org> wrote on 06.03.2012 19:32:41:
Show 12 quoted lines
> Am 06.03.2012 10:18, schrieb karsten.blees@dcon.de: > > On some systems (e.g. Windows XP), directories cannot be deleted while > > they're open. Both git-prune and git-repack (and thus, git-gc) try to > > rmdir while holding a DIR* handle on the directory, leaving dangling > > empty directories in the .git/objects store. > > > > Fix it by swapping the rmdir / closedir calls. > > The reasoning makes a lot of sense. I wonder why object directories are > pruned nevertheless when I run git gc --prune (I run git master plus a > few topics from pu). >
You're right...in upstream git, closedir() is essentially a NOOP. The OS handle is closed in readdir() on reading the last entry. The dirent.c 'improvements' that move FindFirstFile() to opendir() and FindClose() to closedir() are in the msysgit fork only [1] (and entirely my fault, I guess :-)).
So this patch actually isn't currently required for Windows XP (probably other platforms, I don't know).
[1] https://github.com/msysgit/git/commit/e2b3f70b
-- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en