From 4c668b6c0482c5585fd9675e86ee866f13a15fa5 Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Sat, 30 Jul 2022 06:10:25 +0200 Subject: [PATCH] fix: don't use $patch as the original patch --- apatch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apatch b/apatch index b82ecef..c8ec0da 100755 --- a/apatch +++ b/apatch @@ -63,7 +63,7 @@ for patch in $source; do done header="" -if [ -f "$patch" ]; then +if [ -f "$patchpath" ]; then msg "patch exists, trying to extract existing message" # try to extract the original header from the patch patch_start=$(grep -En '^(diff --git|--- )' "$patchpath" | cut -d: -f1 | head -n 1) @@ -81,7 +81,7 @@ fi git apply --reject --whitespace=fix "$patchpath" || { rejects="$(git status --porcelain | grep '\?\? .*\.rej$' | cut -c4-)" if [ -n "$rejects" ]; then - warning "$patch partially applied with rejects" + warning "$1 partially applied with rejects" for reject in $rejects; do target="${reject%.rej}" msg "trying to wiggle $target" @@ -102,7 +102,7 @@ fi git add . - msg "saving patch $patch" + msg "saving patch $1" echo -n "$header" > "$patchpath" git diff --cached >> "$patchpath"