This is version 3, adding that BUG! message if do_not_close was set.
Max, I still hope that this patch series helps also your use case!
Interdiff below the diffstat.
Johannes Schindelin (4):
Demonstrate a Windows file locking issue with `git clone --dissociate`
Consolidate code to close a pack's file descriptor
Add a function to release all packs
clone --dissociate: avoid locking pack files
builtin/clone.c | 4 +++-
cache.h | 1 +
sha1_file.c | 59 +++++++++++++++++++++++++++++-----------------
t/t5700-clone-reference.sh | 21 +++++++++++++++++
4 files changed, 62 insertions(+), 23 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index fe823fe..ca699d7 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -810,7 +810,10 @@ void close_all_packs(void)
struct packed_git *p;
for (p = packed_git; p; p = p->next)
- close_pack(p);
+ if (p->do_not_close)
+ die("BUG! Want to close pack marked 'do-not-close'");
+ else
+ close_pack(p);
}
--
2.6.1.windows.1
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html