From: karsten.blees@dcon.de Date: Tue, 06 Mar 2012 21:47:19 GMT Subject: Re: [PATCH] fix deletion of .git/objects sub-directories in git-prune/repack Message-ID: In-Reply-To: <4F565849.80303@kdbg.org> Johannes Sixt wrote on 06.03.2012 19:32:41: > 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