summaryrefslogtreecommitdiff
path: root/include/git.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-07 16:21:43 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-07 16:28:01 +0100
commit7e15859be6b374ebc4a53a967779dca5afabd762 (patch)
tree29bc73d9e6db0231cc4f5aac94d28ca7140c3a01 /include/git.sh
parentacd3608bb124eb9fe29b015591c4b0c83655be3c (diff)
git.sh: simplify prep_submodules()
copying the module list into tmpdir/ no longer makes sense, because it was only done before when we supported either running the list from "git submodule update", or module.list. since we only support handling of module.list, we can greatly simplify this function. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/git.sh')
-rwxr-xr-xinclude/git.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/git.sh b/include/git.sh
index 3e326255..29739e27 100755
--- a/include/git.sh
+++ b/include/git.sh
@@ -106,13 +106,9 @@ prep_submodules()
mdir="$PWD/config/submodule/$project"
[ -n "$tree" ] && mdir="$mdir/$tree"
- [ -f "$mdir/module.list" ] || return 0
- cat "$mdir/module.list" > "$tmpdir/modules" || \
- $err "!cp $mdir/module.list $tmpdir/modules"
-
- while read -r msrcdir; do
+ [ -f "$mdir/module.list" ] && while read -r msrcdir; do
fetch_submodule "$msrcdir"
- done < "$tmpdir/modules"
+ done < "$mdir/module.list"; return 0
}
fetch_submodule()
@@ -128,6 +124,7 @@ fetch_submodule()
done
rm -Rf "$tmpgit/$1" || $err "!rm '$mdir' '$1'"
+
tmpclone "$subrepo" "$subrepo_bkup" "$tmpdir/$1" "$subrev" \
"$mdir/${1##*/}/patches"
}