From 73af37b81baac1df75fc343deb82d818cb1eaee8 Mon Sep 17 00:00:00 2001 From: CDN Date: Fri, 2 Dec 2022 15:33:24 +0800 Subject: [PATCH] fix: git log should explicitly separate branch from paths (#5911) --- server/modules/storage/git/storage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/storage/git/storage.js b/server/modules/storage/git/storage.js index b047233b..cd69f3e7 100644 --- a/server/modules/storage/git/storage.js +++ b/server/modules/storage/git/storage.js @@ -118,7 +118,7 @@ module.exports = { * SYNC */ async sync() { - const currentCommitLog = _.get(await this.git.log(['-n', '1', this.config.branch]), 'latest', {}) + const currentCommitLog = _.get(await this.git.log(['-n', '1', this.config.branch, '--']), 'latest', {}) const rootUser = await WIKI.models.users.getRootUser() @@ -140,7 +140,7 @@ module.exports = { // Process Changes if (_.includes(['sync', 'pull'], this.mode)) { - const latestCommitLog = _.get(await this.git.log(['-n', '1', this.config.branch]), 'latest', {}) + const latestCommitLog = _.get(await this.git.log(['-n', '1', this.config.branch, '--']), 'latest', {}) const diff = await this.git.diffSummary(['-M', currentCommitLog.hash, latestCommitLog.hash]) if (_.get(diff, 'files', []).length > 0) {