From 82bdf27072e555271fdc3d7cf0081a9e671c3a15 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 18 Jul 2024 23:09:59 +0100 Subject: git.sh: fix lack of error exits on fault a previous change made it more redundant, falling back on old behaviour (direct downloading, not cached), but the way it's done means that the function never returns an error condition in practise. this patch fixes it. Signed-off-by: Leah Rowe --- include/git.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/git.sh b/include/git.sh index 2eea5137..24907a8d 100644 --- a/include/git.sh +++ b/include/git.sh @@ -3,7 +3,7 @@ # Copyright (c) 2022 Caleb La Grange eval `setvars "" loc url bkup_url subfile subhash subrepo subrepo_bkup \ - depend subfile_bkup` + depend subfile_bkup repofail` fetch_targets() { @@ -101,6 +101,8 @@ fetch_submodule() tmpclone() { + repofail="n" + [ $# -lt 6 ] || rm -Rf "$3" || $err "git retry: !rm $3 ($1)" repodir="cache/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3" x_ mkdir -p "cache/repo" @@ -115,7 +117,10 @@ tmpclone() [ $# -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" - ) || [ $# -gt 5 ] || tmpclone $@ retry; : + ) || repofail="y" + + [ "$repofail" = "y" ] && [ $# -lt 6 ] && tmpclone $@ retry + [ "$repofail" = "y" ] && $err "!clone $1 $2 $3 $4 $5"; : } git_am_patches() -- cgit v1.2.1