Skip to content

Commit

Permalink
Correctly handle moved files in apply patch
Browse files Browse the repository at this point in the history
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 go-gitea#22083

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Dec 13, 2022
1 parent 87c64f6 commit 494a122
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions services/pull/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 494a122

Please sign in to comment.