Skip to content
  • Jeff King's avatar
    tree-walk.c: break circular dependency with unpack-trees · 5290d451
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    The unpack-trees API depends on the tree-walk API. But we've recently
    introduced a dependency in tree-walk.c on MAX_UNPACK_TREES, which
    doesn't otherwise care about unpack-trees at all.
    
    Let's break that dependency by reversing the constants: we'll introduce
    a new MAX_TRAVERSE_TREES which belongs to the tree-walk API. And then we
    can define MAX_UNPACK_TREES in terms of that (since unpack-trees cannot
    possibly work with more trees than it can traverse at once via
    tree-walk).
    
    The value for both will remain at 8. This is somewhat arbitrary and
    probably more than is necessary, per ca885a4f
    
     (read-tree() and
    unpack_trees(): use consistent limit, 2008-03-13), but there's not
    really any pressing need to reduce it.
    
    Suggested-by: default avatarElijah Newren <newren@gmail.com>
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Acked-by: default avatarElijah Newren <newren@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    5290d451