From a480919ec3ff361c6aef97cce24fbed88213cabc Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Mon, 26 Apr 2021 09:05:53 +0900 Subject: [PATCH] fix error on auto commit for no flow change --- .../lib/storage/localfilesystem/projects/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js index 0533fe5e6..1565decdd 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js @@ -608,8 +608,15 @@ async function saveFlows(flows, user) { var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode; if (workflowMode === 'auto') { return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => { - return activeProject.commit(user,{message:"Update flow files"}) - }) + return activeProject.status(user, false).then((result) => { + const items = Object.values(result.files || {}); + // check if saved flow make modification to repository + if (items.findIndex((item) => (item.status === "M ")) < 0) { + return Promise.resolve(); + } + return activeProject.commit(user,{message:"Update flow files"}) + }); + }); } } });