aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2006-11-01 17:06:21 -0500
committerJunio C Hamano <junkio@cox.net>2006-11-03 00:24:07 -0800
commitfc04c412d8d2412e97bb2a664a1746e333dfd9ae (patch)
tree9aa24c52b0571079e2c53910e1d8105c6e6ca005 /sha1_file.c
parentbed006fbddf919eed81cf62954e0332a395bf035 (diff)
downloadgit-fc04c412d8d2412e97bb2a664a1746e333dfd9ae.tar.gz
git-fc04c412d8d2412e97bb2a664a1746e333dfd9ae.tar.xz
Teach receive-pack how to keep pack files based on object count.
Since keeping a pushed pack or exploding it into loose objects should be a local repository decision this teaches receive-pack to decide if it should call unpack-objects or index-pack --stdin --fix-thin based on the setting of receive.unpackLimit and the number of objects contained in the received pack. If the number of objects (hdr_entries) in the received pack is below the value of receive.unpackLimit (which is 5000 by default) then we unpack-objects as we have in the past. If the hdr_entries >= receive.unpackLimit then we call index-pack and ask it to include our pid and hostname in the .keep file to make it easier to identify why a given pack has been kept in the repository. Currently this leaves every received pack as a kept pack. We really don't want that as received packs will tend to be small. Instead we want to delete the .keep file automatically after all refs have been updated. That is being left as room for future improvement. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 2aa944abd..6ea59b558 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -663,7 +663,7 @@ void prepare_packed_git(void)
prepare_packed_git_run_once = 1;
}
-static void reprepare_packed_git(void)
+void reprepare_packed_git(void)
{
prepare_packed_git_run_once = 0;
prepare_packed_git();