summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-01-01 19:06:01 +0000
committerLeah Rowe <leah@libreboot.org>2024-01-01 19:07:37 +0000
commit3b66a5bbfbd9f1099a15d27753d2904643522255 (patch)
tree1c7ed584ce10ff0be6dee89915d4546ae7a3027b /include
parenta7f58abb5a4540fbc7c48e1b9f91283d8ca59df7 (diff)
git.cfg: simplified revision checking
it only needs to be checked before git reset Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/git.sh12
1 files changed, 3 insertions, 9 deletions
diff --git a/include/git.sh b/include/git.sh
index 14fb2dc1..d1e9389b 100755
--- a/include/git.sh
+++ b/include/git.sh
@@ -11,7 +11,6 @@ fetch_project_trees()
_target="${target}"
[ -d "src/${project}/${project}" ] || fetch_from_upstream
fetch_config
- [ -z "${rev}" ] && err "fetch_project_trees $target: undefined rev"
if [ -d "src/${project}/${tree}" ]; then
printf "download/%s %s (%s): exists\n" \
"${project}" "${tree}" "${_target}" 1>&2
@@ -62,7 +61,8 @@ prepare_new_tree()
fetch_project_repo()
{
scan_config "${project}" "config/git" "err"
- verify_config
+ [ -z "${loc+x}" ] && err "fetch_project_repo $project: loc not set"
+ [ -z "${url+x}" ] && err "fetch_project_repo $project: url not set"
clone_project
[ -z "${depend}" ] || for d in ${depend} ; do
@@ -71,13 +71,6 @@ fetch_project_repo()
rm -Rf "${tmpgit}" || err "fetch_repo: !rm -Rf ${tmpgit}"
}
-verify_config()
-{
- [ -z "${rev+x}" ] && err 'verify_config: rev not set'
- [ -z "${loc+x}" ] && err 'verify_config: loc not set'
- [ -z "${url+x}" ] && err 'verify_config: url not set'; return 0
-}
-
clone_project()
{
loc="${loc#src/}"
@@ -97,6 +90,7 @@ git_prep()
_patchdir="$1"
_loc="$2"
+ [ -z "${rev+x}" ] && err "git_prep $_loc: rev not set"
git -C "$tmpgit" reset --hard $rev || err "git -C $_loc: !reset $rev"
git_am_patches "$tmpgit" "$_patchdir" || err "!am $_loc $_patchdir"