From ff0007366607733a38875a1c5605b28739b7098e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 30 Jun 2024 18:23:15 +0100 Subject: [PATCH] git.sh: simpler for loop in git_am_patches() Signed-off-by: Leah Rowe --- include/git.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/git.sh b/include/git.sh index 70ec087..b0acd7d 100755 --- a/include/git.sh +++ b/include/git.sh @@ -110,11 +110,10 @@ tmpclone() git_am_patches() { - for _patch in "$2/"*; do - [ -L "$_patch" ] || [ ! -f "$_patch" ] || git -C "$1" am \ - "$_patch" || $err "$1 $2: !git am $_patch" - [ -L "$_patch" ] || [ ! -d "$_patch" ] || \ - git_am_patches "$1" "$_patch"; continue + 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; return 0 }