[PATCH v3 0/4] Fix locking issues on Windows with `git clone --dissociate`
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 6, 2015, 13:17 UTC
- Message-ID
- <cover.1444131898.git.johannes.schindelin@gmx.de>
- In-Reply-To
- <682991036f1e8e974ed8ecd7d20dbcc6fb86c344.1443469464.git.johannes.schindelin@gmx.de>
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