From 494a12233ff763de4b5f614588979363b5822009 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Tue, 13 Dec 2022 09:17:52 +0000 Subject: [PATCH] Correctly handle moved files in apply patch Moved files in a patch will result in git apply returning: ``` error: {filename}: No such file or directory ``` This wasn't handled by the git apply patch code. This PR adds handling for this. Fix #22083 Signed-off-by: Andrew Thornton --- services/pull/patch.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/pull/patch.go b/services/pull/patch.go index 809b75e6b4536..f3ade6c0e63ac 100644 --- a/services/pull/patch.go +++ b/services/pull/patch.go @@ -53,6 +53,7 @@ var patchErrorSuffices = []string{ ": patch does not apply", ": already exists in working directory", "unrecognized input", + ": No such file or directory", } // TestPatch will test whether a simple patch will apply