fix: don't use $patch as the original patch
This commit is contained in:
parent
f80c534323
commit
4c668b6c04
6
apatch
6
apatch
|
@ -63,7 +63,7 @@ for patch in $source; do
|
||||||
done
|
done
|
||||||
|
|
||||||
header=""
|
header=""
|
||||||
if [ -f "$patch" ]; then
|
if [ -f "$patchpath" ]; then
|
||||||
msg "patch exists, trying to extract existing message"
|
msg "patch exists, trying to extract existing message"
|
||||||
# try to extract the original header from the patch
|
# try to extract the original header from the patch
|
||||||
patch_start=$(grep -En '^(diff --git|--- )' "$patchpath" | cut -d: -f1 | head -n 1)
|
patch_start=$(grep -En '^(diff --git|--- )' "$patchpath" | cut -d: -f1 | head -n 1)
|
||||||
|
@ -81,7 +81,7 @@ fi
|
||||||
git apply --reject --whitespace=fix "$patchpath" || {
|
git apply --reject --whitespace=fix "$patchpath" || {
|
||||||
rejects="$(git status --porcelain | grep '\?\? .*\.rej$' | cut -c4-)"
|
rejects="$(git status --porcelain | grep '\?\? .*\.rej$' | cut -c4-)"
|
||||||
if [ -n "$rejects" ]; then
|
if [ -n "$rejects" ]; then
|
||||||
warning "$patch partially applied with rejects"
|
warning "$1 partially applied with rejects"
|
||||||
for reject in $rejects; do
|
for reject in $rejects; do
|
||||||
target="${reject%.rej}"
|
target="${reject%.rej}"
|
||||||
msg "trying to wiggle $target"
|
msg "trying to wiggle $target"
|
||||||
|
@ -102,7 +102,7 @@ fi
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
|
|
||||||
msg "saving patch $patch"
|
msg "saving patch $1"
|
||||||
echo -n "$header" > "$patchpath"
|
echo -n "$header" > "$patchpath"
|
||||||
git diff --cached >> "$patchpath"
|
git diff --cached >> "$patchpath"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue