From 33ec2ca026d568c4820324752be09a51460b7005 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Thu, 9 Dec 2021 22:43:20 -0800 Subject: [PATCH] sync: improve patch application process by using patch command git apply -3 doesn't always leave conflicted files in the working directory. Use patch --merge instead, it seems to work better in more complicated situations. Signed-off-by: Andrii Nakryiko --- scripts/sync-kernel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sync-kernel.sh b/scripts/sync-kernel.sh index 9ea1d56..45b4212 100755 --- a/scripts/sync-kernel.sh +++ b/scripts/sync-kernel.sh @@ -264,7 +264,7 @@ git checkout -b ${LIBBPF_SYNC_TAG} for patch in $(ls -1 ${TMP_DIR}/patches | tail -n +2); do if ! git am -3 --committer-date-is-author-date "${TMP_DIR}/patches/${patch}"; then - if ! git apply -3 "${TMP_DIR}/patches/${patch}"; then + if ! patch -p1 --merge < "${TMP_DIR}/patches/${patch}"; then read -p "Applying ${TMP_DIR}/patches/${patch} failed, please resolve manually and press to proceed..." fi git am --continue