From 3b66a5bbfbd9f1099a15d27753d2904643522255 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 1 Jan 2024 19:06:01 +0000 Subject: git.cfg: simplified revision checking it only needs to be checked before git reset Signed-off-by: Leah Rowe --- include/git.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'include') 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" -- cgit v1.2.1