diff options
author | Jeff King <peff@peff.net> | 2020-02-01 12:39:22 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-04 19:32:15 +0100 |
commit | 5290d4513496d89f84570985a0e02e97dff477ff (patch) | |
tree | 0087ed94f0234309e2d4862c1d7e6e4e809a8890 /unpack-trees.h | |
parent | traverse_trees(): use stack array for name entries (diff) | |
download | git-5290d4513496d89f84570985a0e02e97dff477ff.tar.xz git-5290d4513496d89f84570985a0e02e97dff477ff.zip |
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 <newren@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.h')
-rw-r--r-- | unpack-trees.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unpack-trees.h b/unpack-trees.h index ca94a421a5..ae1557fb80 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -6,7 +6,7 @@ #include "string-list.h" #include "tree-walk.h" -#define MAX_UNPACK_TREES 8 +#define MAX_UNPACK_TREES MAX_TRAVERSE_TREES struct cache_entry; struct unpack_trees_options; |