Close the file before unlinking I forgot that Windows chokes while trying to delete open files.
diff --git a/src/indexer.c b/src/indexer.c
index 27f4947..9315362 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -1091,6 +1091,12 @@ void git_indexer_free(git_indexer *idx)
git_vector_free_deep(&idx->deltas);
/* Try to delete the temporary file in case it was not committed. */
+ git_mwindow_free_all(&idx->pack->mwf);
+ /* We need to close the descriptor here so Windows doesn't choke on unlink */
+ if (idx->pack->mwf.fd != -1) {
+ (void)p_close(idx->pack->mwf.fd);
+ idx->pack->mwf.fd = -1;
+ }
(void)p_unlink(idx->pack->pack_name);
if (!git_mutex_lock(&git__mwindow_mutex)) {