Code

Teach git-index-pack how to keep a pack file.
authorShawn Pearce <spearce@spearce.org>
Sun, 29 Oct 2006 09:41:59 +0000 (04:41 -0500)
committerJunio C Hamano <junkio@cox.net>
Sun, 29 Oct 2006 21:45:03 +0000 (13:45 -0800)
commitb8077709243138c3d8cc1c096c06a95b250a9001
tree5ceb0feedf42c88fafc1210f826678c3c87e488a
parent01cff2d2ca77dc050973e1fc4702119a715cc919
Teach git-index-pack how to keep a pack file.

To prevent a race condition between `index-pack --stdin` and
`repack -a -d` where the repack deletes the newly created pack
file before any refs are updated to reference objects contained
within it we mark the pack file as one that should be kept.  This
removes it from the list of packs that `repack -a -d` will consider
for removal.

Callers such as `receive-pack` which want to invoke `index-pack`
should use this new --keep option to prevent the newly created pack
and index file pair from being deleted before they have finished any
related ref updates.  Only after all ref updates have been finished
should the associated .keep file be removed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-index-pack.txt
index-pack.c