summaryrefslogtreecommitdiff
path: root/cache-tree.h
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2007-11-13 23:48:42 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-11-13 21:57:53 -0800
commit436e7a74c638bc9de2e585ce3eb0fd4bd6e06115 (patch)
treecc5c70ae6761b14766e9c444ba43c517fea4ffdc /cache-tree.h
parentrevert/cherry-pick: allow starting from dirty work tree. (diff)
downloadtgif-436e7a74c638bc9de2e585ce3eb0fd4bd6e06115.tar.xz
Don't allow fast-import tree delta chains to exceed maximum depth
Brian Downing noticed fast-import can produce tree depths of up to 6,035 objects and even deeper. Long delta chains can create very small packfiles but cause problems during repacking as git needs to unpack each tree to count the reachable blobs. What's happening here is the active branch cache isn't big enough. We're swapping out the branch and thus recycling the tree information (struct tree_content) back into the free pool. When we later reload the tree we set the delta_depth to 0 but we kept the tree we just reloaded as a delta base. So if the tree we reloaded was already at the maximum depth we wouldn't know it and make the new tree a delta. Multiply the number of times the branch cache has to swap out the tree times max_depth (10) and you get the maximum delta depth of a tree created by fast-import. In Brian's case above the active branch cache had to swap the branch out 603/604 times during this import to produce a tree with a delta depth of 6035. Acked-by: Brian Downing <bdowning@lavos.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache-tree.h')
0 files changed, 0 insertions, 0 deletions