summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-08 22:19:54 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-08 22:19:54 +0100
commitb0e5fa255ea53e0c82a5a6808821817773237c96 (patch)
treeb800db215bf4595c5917a46b2ad0d0db119bc34e /include
parent15461df2e840263cefb88f7611953d167b883238 (diff)
parent1ce3e7a3d39cced1749b909fba9228b877c77339 (diff)
Merge branch 'master' into 25.04_branch25.04_branch
Diffstat (limited to 'include')
-rw-r--r--include/git.sh28
1 files changed, 5 insertions, 23 deletions
diff --git a/include/git.sh b/include/git.sh
index 81c75806..9440b1af 100644
--- a/include/git.sh
+++ b/include/git.sh
@@ -89,30 +89,12 @@ fetch_submodule()
tmpclone()
{
- livepull="n" && [ "$repofail" = "y" ] && \
- printf "Cached clone failed; trying online.\n" 1>&2 && livepull="y"
-
- repofail="n"
-
- [ $# -lt 6 ] || rm -Rf "$3" || err "git retry: !rm $3 ($1)"
- repodir="$XBMK_CACHE/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3"
- mkdir -p "$XBMK_CACHE/repo" || err "!rmdir $XBMK_CACHE/repo"
-
- if [ "$livepull" = "y" ] && [ ! -d "$repodir" ]; then
- git clone "$1" "$repodir" || git clone $2 "$repodir" || \
- err "!clone $1 $2 $repodir $4 $5" #
- elif [ -d "$repodir" ] && [ $# -lt 6 ]; then
- git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \
- || sleep 3 || git -C "$repodir" pull || :
- fi
- (
- [ $# -gt 5 ] || git clone "$repodir" "$3" || err "!clone $repodir $3"
- git -C "$3" reset --hard "$4" || err "!reset $1 $2 $3 $4 $5"
+ [ -d "$3" ] && return 0
+ printf "Creating git clone '%s' from '%s', '%s'\n" "$3" "$1" "$2"
+ git clone "$1" "$3" || x_ rm -Rf "$3"
+ [ -d "$3" ] || x_ git clone "$2" "$3"
+ x_ git -C "$3" reset --hard "$4"
fx_ "eval x_ git -C \"$3\" am" find "$5" -type f
- ) || repofail="y"
-
- [ "$repofail" = "y" ] && [ $# -lt 6 ] && tmpclone "$@" retry
- [ "$repofail" = "y" ] && err "!clone $1 $2 $3 $4 $5"; :
}
nuke()