From 5290d4513496d89f84570985a0e02e97dff477ff Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 1 Feb 2020 06:39:22 -0500 Subject: tree-walk.c: break circular dependency with unpack-trees 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 ca885a4fe6 (read-tree() and unpack_trees(): use consistent limit, 2008-03-13), but there's not really any pressing need to reduce it. Suggested-by: Elijah Newren Signed-off-by: Jeff King Acked-by: Elijah Newren Signed-off-by: Junio C Hamano --- tree-walk.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tree-walk.h') diff --git a/tree-walk.h b/tree-walk.h index 826396c8ed..a5058469e9 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -3,6 +3,8 @@ #include "cache.h" +#define MAX_TRAVERSE_TREES 8 + /** * The tree walking API is used to traverse and inspect trees. */ -- cgit v1.2.3