summaryrefslogtreecommitdiff
path: root/script/update/project/trees
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-25 12:17:02 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-25 12:21:23 +0100
commit81d073d5a193f2a07ca8efbb1a337a69c1c6d778 (patch)
treecdd09f636a674e7eb94f194d0fea7af6e9a596d5 /script/update/project/trees
parenteae173ec134809966cd962c1a3c0333583306a11 (diff)
update/project/*: unified git reset handling
With this change, lbmk now also updates submodules on simple git clones, not just multi-tree clones. This is OK, because git does not return non-zero status when git submodule update is ran, where git submodules are not actually defined. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/update/project/trees')
-rwxr-xr-xscript/update/project/trees10
1 files changed, 3 insertions, 7 deletions
diff --git a/script/update/project/trees b/script/update/project/trees
index 27418f19..af8e4ed0 100755
--- a/script/update/project/trees
+++ b/script/update/project/trees
@@ -143,13 +143,9 @@ prepare_new_tree()
cp -R "${project}/${project}" "${project}/${tree}" || \
err "${project}/${tree}: cannot copy source tree"
- (
- cd "${project}/${tree}" || err "cannot cd to ${project}/${tree}"
- git reset --hard ${rev} || \
- err "cannot reset ${project} revision for tree, ${tree}"
- git submodule update --init --checkout || \
- err "cannot update ${project} submodules for tree, ${tree}"
- )
+ git_reset_rev "${project}/${tree}" "${rev}" "err" || \
+ err "prepare_new_trees ${project}/${tree}: cannot reset <- ${rev}"
+
git_am_patches "${PWD}/${project}/${tree}" \
"${PWD}/${cfgsdir}/${tree}/patches" "err" || \
err "prepare_new_trees ${project}/${tree}: cannot apply patches"