mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-14 23:39:33 +02:00
git.sh: Simplify git am handling
fx_ and fe_ really are the best shell functions ever. really. they're the best. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+1
-11
@@ -108,23 +108,13 @@ tmpclone()
|
|||||||
(
|
(
|
||||||
[ $# -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" || err "!reset $1 $2 $3 $4 $5"
|
||||||
git_am_patches "$3" "$5"
|
fx_ "eval x_ git -C \"$3\" am" "$5" -type f
|
||||||
) || repofail="y"
|
) || repofail="y"
|
||||||
|
|
||||||
[ "$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"; :
|
||||||
}
|
}
|
||||||
|
|
||||||
git_am_patches()
|
|
||||||
{
|
|
||||||
for p in "$2/"*; do
|
|
||||||
[ -L "$p" ] && continue
|
|
||||||
[ -e "$p" ] || continue
|
|
||||||
[ -d "$p" ] && git_am_patches "$1" "$p" && continue
|
|
||||||
[ ! -f "$p" ] || git -C "$1" am "$p" || err "$1 $2: !am $p"
|
|
||||||
done; :
|
|
||||||
}
|
|
||||||
|
|
||||||
nuke()
|
nuke()
|
||||||
{
|
{
|
||||||
e "config/${1%/}/nuke.list" f missing || while read -r nukefile; do
|
e "config/${1%/}/nuke.list" f missing || while read -r nukefile; do
|
||||||
|
|||||||
Reference in New Issue
Block a user