summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-18 02:25:16 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-18 02:25:16 +0100
commit8d57bf6009e3eb6ed0dfab042981a700e9f093a3 (patch)
tree41b95483a8c6aaa0d309f9f8262a16fb3d32d37d /include
parenta2898771f6e3950cca9f6ba0e6510e06064d6256 (diff)
Revert "git.sh: minor cleanup"
This reverts commit e63d8dd20d99ec18ef03699516fd800a81b7f1df.
Diffstat (limited to 'include')
-rw-r--r--include/git.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/git.sh b/include/git.sh
index 74942414..4fa904ba 100644
--- a/include/git.sh
+++ b/include/git.sh
@@ -99,21 +99,24 @@ fetch_submodule()
tmpclone()
{
- eval "`setvars "n" livepull repofail`"
- [ "$repofail" = "y" ] && livepull="y"
+ 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" || x_ git clone $2 "$repodir"
+ 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 ] || x_ git clone "$repodir" "$3"
+ [ $# -gt 5 ] || git clone "$repodir" "$3" || $err "!clone $repodir $3"
git -C "$3" reset --hard "$4" || $err "!reset $1 $2 $3 $4 $5"
git_am_patches "$3" "$5"
) || repofail="y"