From 54610b939f15fc700629d557810a34bcaa5f7efb Mon Sep 17 00:00:00 2001 From: Margen67 Date: Mon, 27 Jan 2025 19:24:48 -0800 Subject: [PATCH] [xb] Fall back to normal clone if shallow fails --- xenia-build | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/xenia-build b/xenia-build index c778f8286..3e3c75dea 100755 --- a/xenia-build +++ b/xenia-build @@ -417,16 +417,26 @@ def git_is_repository(): def git_submodule_update(): """Runs a git submodule init and update. """ - shell_call([ + ret = shell_call([ 'git', '-c', 'fetch.recurseSubmodules=on-demand', 'submodule', 'update', '--init', - #'-j', args['j'], # These would be faster if they worked - #'--depth 1', - ]) + '--depth=1', + '-j', str(os.cpu_count()), + ], throw_on_error=False) + if ret != 0: + print('Shallow submodule update failed, falling back to normal...') + shell_call([ + 'git', + '-c', + 'fetch.recurseSubmodules=on-demand', + 'submodule', + 'update', + '--init', + ]) def get_clang_format_binary():