fix: wiki delete issue
Fixes #7596
Describe the pull request
It seems there's an issue with the handling of special characters in wiki names, where Git internally escapes them. This creates a mismatch between the escaped filenames and the actual filenames, making it challenging to delete files accurately. As a result, the deletion process is not functioning as expected.
According to the Git documentation, when the -z option is used, filenames are not quoted, and the output is terminated with a null character (\0). For more clarification, refer to the documentation on core.quotePath as well.
This pull request addresses the issue by incorporating a conditional check for the -z option during the git ls-tree operation. It also updates the line terminator in the parseTree function accordingly.
This particular modification is not sufficient to fully resolve the issue. Another pull request will be submitted in the gogs/gogs repository to address the remaining aspects of the problem.
https://github.com/gogs/git-module/assets/25850690/d6c0ea9f-0d5f-4ca0-b31b-ad869f348974
Link to the issue: #7596
Checklist
- [x] I agree to follow the Code of Conduct by submitting this pull request.
- [x] I have read and acknowledge the Contributing guide.
- [x] I have added test cases to cover the new code.