Use pack-*.keep files during fetch and receive-pack to prevent GC
commit1af74346607963afc65ff8accc1ceb9be1a10e26
authorShawn O. Pearce <spearce@spearce.org>
Mon, 4 May 2009 20:34:52 +0000 (4 13:34 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Mon, 4 May 2009 22:42:21 +0000 (5 00:42 +0200)
tree08d985f0460e41146ba2da233f170861ea8c3ae8
parent652d889d6a54f1951547cf6fbac18dcbed757d5e
Use pack-*.keep files during fetch and receive-pack to prevent GC

C Git creates a pack-*.keep for a pack file while the pack file is
being stored on disk between the time it is initially created by
index-pack and when all refs finished being updated with the new
values.  By creating this file we permit concurrent "git gc" or
"git repack" in a repository while a fetch or push into the same
repository is occurring.  The pack-*.keep file prevents the gc
task from deleting the pack file, which is necessary to prevent
the objects from disappearing, as the contained objects were not
reachable from the set of existing refs when the gc started.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/lib/PackLock.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/transport/BasePackFetchConnection.java
org.spearce.jgit/src/org/spearce/jgit/transport/BundleFetchConnection.java
org.spearce.jgit/src/org/spearce/jgit/transport/FetchConnection.java
org.spearce.jgit/src/org/spearce/jgit/transport/FetchProcess.java
org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java
org.spearce.jgit/src/org/spearce/jgit/transport/ReceivePack.java
org.spearce.jgit/src/org/spearce/jgit/transport/WalkFetchConnection.java