diff options
author | Leah Rowe <leah@libreboot.org> | 2024-07-18 23:09:59 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-07-18 23:09:59 +0100 |
commit | 82bdf27072e555271fdc3d7cf0081a9e671c3a15 (patch) | |
tree | d8b7ad3553a59257c42dab91ac399c601242ff4a | |
parent | 64283a1fb1fc3b0e6f0c0601f029d06938df0274 (diff) |
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 <leah@libreboot.org>
-rw-r--r-- | include/git.sh | 9 |
1 files 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 <thonkpeasant@protonmail.com> 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() |