Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tree-walk.c')
-rw-r--r--tree-walk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tree-walk.c b/tree-walk.c
index 4efd0fc391..b517792ba2 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -9,6 +9,7 @@
#include "tree.h"
#include "pathspec.h"
#include "json-writer.h"
+#include "environment.h"
static const char *get_mode(const char *str, unsigned int *modep)
{
@@ -449,6 +450,9 @@ int traverse_trees(struct index_state *istate,
int interesting = 1;
char *traverse_path;
+ if (traverse_trees_cur_depth > max_allowed_tree_depth)
+ return error("exceeded maximum allowed tree depth");
+
traverse_trees_count++;
traverse_trees_cur_depth++;