diff --git a/environment.c b/environment.c index 921ed89a2a..ac38ed0ef0 100644 --- a/environment.c +++ b/environment.c @@ -102,9 +102,21 @@ int max_allowed_tree_depth = * tree depth; This value seems to be low enough. */ 1280; +#else +#if defined(GIT_WINDOWS_NATIVE) && defined(__clang__) && defined(__aarch64__) + /* + * Similar to Visual C, it seems that on Windows/ARM64 the clang-based + * builds have a smaller stack space available. When running out of + * that stack space, a `STATUS_STACK_OVERFLOW` is produced. When the + * Git command was run from an MSYS2 Bash, this unfortunately results + * in an exit code 127. Let's prevent that by lowering the maximal + * tree depth; This value seems to be low enough. + */ + 1280; #else 2048; #endif +#endif #ifndef PROTECT_HFS_DEFAULT #define PROTECT_HFS_DEFAULT 0