diff options
Diffstat (limited to 'include/git.sh')
-rw-r--r-- | include/git.sh | 11 |
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" |