mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-13 06:49:52 +02:00
git.sh: Hard fail if reset fails
We allow a re-try when cloning fails, to account for redundancy, but resetfail currently doesn't cause any error exit at all. This patch mitigates that bug. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+5
-1
@@ -92,6 +92,7 @@ tmpclone()
|
|||||||
livepull="n" && [ "$repofail" = "y" ] && \
|
livepull="n" && [ "$repofail" = "y" ] && \
|
||||||
printf "Cached clone failed; trying online.\n" 1>&2 && livepull="y"
|
printf "Cached clone failed; trying online.\n" 1>&2 && livepull="y"
|
||||||
|
|
||||||
|
resetfail="n"
|
||||||
repofail="n"
|
repofail="n"
|
||||||
|
|
||||||
[ $# -lt 6 ] || rm -Rf "$3" || err "git retry: !rm $3 ($1)"
|
[ $# -lt 6 ] || rm -Rf "$3" || err "git retry: !rm $3 ($1)"
|
||||||
@@ -107,10 +108,13 @@ tmpclone()
|
|||||||
fi
|
fi
|
||||||
(
|
(
|
||||||
[ $# -gt 5 ] || git clone "$repodir" "$3" || err "!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 -C "$3" reset --hard "$4" || resetfail="y"
|
||||||
|
[ "$resetfail" = "y" ] && err "'$3': Cannot reset to rev '$4'"
|
||||||
fx_ "eval x_ git -C \"$3\" am" find "$5" -type f
|
fx_ "eval x_ git -C \"$3\" am" find "$5" -type f
|
||||||
) || repofail="y"
|
) || repofail="y"
|
||||||
|
|
||||||
|
[ "$resetfail" = "y" ] && err "Cannot reset revisions"
|
||||||
|
|
||||||
[ "$repofail" = "y" ] && [ $# -lt 6 ] && tmpclone "$@" retry
|
[ "$repofail" = "y" ] && [ $# -lt 6 ] && tmpclone "$@" retry
|
||||||
[ "$repofail" = "y" ] && err "!clone $1 $2 $3 $4 $5"; :
|
[ "$repofail" = "y" ] && err "!clone $1 $2 $3 $4 $5"; :
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user