diff options
author | Leah Rowe <leah@libreboot.org> | 2023-12-19 03:53:47 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-12-19 03:53:47 +0000 |
commit | 7f98ab8e62ba0efd0ec4e027599edd566ac14a07 (patch) | |
tree | 92d8a584726446aa625d70e6d9e21605658fedc0 /include/git.sh | |
parent | 124b5bebd6204c16ec989aee7e8c7f9ff16b086b (diff) |
git.sh: simplify submodule handling
do not use a subshell. use git -C instead.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/git.sh')
-rwxr-xr-x | include/git.sh | 11 |
1 files changed, 3 insertions, 8 deletions
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" |