summaryrefslogtreecommitdiff
path: root/include/git.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-08 22:05:28 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-08 22:14:43 +0100
commit0d876622fcb715eb8cfc03a1bf9bb138fd845731 (patch)
tree28128d4e11fd97466e7ad5ae647163f18000869d /include/git.sh
parent454f11bdd7bf7409276b2e0fc301a061b258e8d9 (diff)
git.sh: re-write tmpclone without caching
remove caching for now. it's buggy as hell. will re-write the caching feature next. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/git.sh')
-rw-r--r--include/git.sh34
1 files changed, 6 insertions, 28 deletions
diff --git a/include/git.sh b/include/git.sh
index 14def209..9440b1af 100644
--- a/include/git.sh
+++ b/include/git.sh
@@ -89,34 +89,12 @@ fetch_submodule()
tmpclone()
{
- livepull="n" && [ "$repofail" = "y" ] && \
- printf "Cached clone failed; trying online.\n" 1>&2 && livepull="y"
-
- eval "`setvars "n" resetfail repofail amfail`"
-
- [ $# -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" || resetfail="y"
- [ "$resetfail" = "y" ] || ( fx_ "eval x_ git -C \"$3\" am" find "$5" \
- -type f ) || amfail="y"
- ) || repofail="y"
-
- [ "$resetfail" = "y" ] && err "Cannot reset revisions"
- [ "$amfail" = "y" ] && err "Cannot apply patches"
-
- [ "$repofail" = "y" ] && [ $# -lt 6 ] && tmpclone "$@" retry
- [ "$repofail" = "y" ] && err "!clone $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
}
nuke()