summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-30 18:23:15 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-30 18:23:15 +0100
commit0018600d6e21f69eb00651e88074920b2a8f62d7 (patch)
tree43f55e52ae1ffcdd10a483aa86225dbc6cf3aa37 /include
parent5882056a27b91e4b947951501c8dbee9b811c4a5 (diff)
git.sh: simpler for loop in git_am_patches()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/git.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/git.sh b/include/git.sh
index 70ec087c..b0acd7dc 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
}