summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-12-19 03:53:47 +0000
committerLeah Rowe <leah@libreboot.org>2023-12-19 03:53:47 +0000
commit7f98ab8e62ba0efd0ec4e027599edd566ac14a07 (patch)
tree92d8a584726446aa625d70e6d9e21605658fedc0 /include
parent124b5bebd6204c16ec989aee7e8c7f9ff16b086b (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')
-rwxr-xr-xinclude/git.sh11
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"