Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 gitls-tree
operation. It also updates the line terminator in theparseTree
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.
Delete.Wiki.Pages.mov
Link to the issue: #7596
Checklist