]> source.dussan.org Git - gitea.git/commit
Fix GetFilesChangedBetween if the file name may be escaped (#23272) (#23278)
authorGiteabot <teabot@gitea.io>
Sat, 4 Mar 2023 07:11:50 +0000 (02:11 -0500)
committerGitHub <noreply@github.com>
Sat, 4 Mar 2023 07:11:50 +0000 (02:11 -0500)
commit2f1d968b272c247dd8b46c5be7d308cb1888d24a
tree51e7c44c33ff9b1704a9bf7b7db95acaad9f9152
parent0c212b3f088bd5c0fbb389126e988760adb8e620
Fix GetFilesChangedBetween if the file name may be escaped (#23272) (#23278)

Backport #23272

The code for GetFilesChangedBetween uses `git diff --name-only
base..head` to get the names of files changed between base and head
however this forgets that git will escape certain values.

This PR simply switches to use `-z` which has the `NUL` character as the
separator.

Ref https://github.com/go-gitea/gitea/pull/22568#discussion_r1123138096

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
modules/git/repo_compare.go