From 7f98ab8e62ba0efd0ec4e027599edd566ac14a07 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 19 Dec 2023 03:53:47 +0000 Subject: git.sh: simplify submodule handling do not use a subshell. use git -C instead. Signed-off-by: Leah Rowe --- include/git.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/git.sh b/include/git.sh index 7d06479a..e361cb41 100755 --- a/include/git.sh +++ b/include/git.sh @@ -65,14 +65,9 @@ prepare_new_tree() cp -R "src/${project}/${project}" "${tmp_git_dir}" || \ err "prepare_new_tree ${project}/${tree}: can't make tmpclone" git_reset_rev "${tmp_git_dir}" "${rev}" - ( - cd "${tmp_git_dir}" || \ - err "prepare_new_tree ${project}/${tree}: can't cd tmpclone" - if [ -f ".gitmodules" ]; then - git submodule update --init --checkout || \ - err "prepare_new_tree ${project}/${tree}: !submodules" - fi - ) || err "git submodule update failure" + [ ! -f "${tmp_git_dir}/.gitmodules" ] || \ + git -C "${tmp_git_dir}" submodule update --init --checkout \ + || err "prepare_new_tree ${project}/${tree}: !submodules" git_am_patches "${tmp_git_dir}" "$PWD/$cfgsdir/$tree/patches" || \ err "prepare_new_tree ${project}/${tree}: patch fail" [ "${patchfail}" = "y" ] && err "PATCH FAIL" -- cgit v1.2.1