From b3731dd26e0d0173abeb27032708847fb361d3fa Mon Sep 17 00:00:00 2001 From: myml Date: Tue, 10 May 2022 09:39:08 +0800 Subject: [PATCH] fix: handle unicode chars when syncing files using git storage (#5272) git has the quotopath option enabled by default, filepaths with unicode characters will be escaped, causing the wiki to not handle changes. --- server/modules/storage/git/storage.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/modules/storage/git/storage.js b/server/modules/storage/git/storage.js index ee8ce503..2b175d48 100644 --- a/server/modules/storage/git/storage.js +++ b/server/modules/storage/git/storage.js @@ -45,6 +45,10 @@ module.exports = { await this.git.init() } + // Disable quotePath + // Link https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath + await this.git.raw(['config', '--local', 'core.quotepath', false]) + // Set default author await this.git.raw(['config', '--local', 'user.email', this.config.defaultEmail]) await this.git.raw(['config', '--local', 'user.name', this.config.defaultName])