1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

fix error on auto commit for no flow change

This commit is contained in:
Hiroyasu Nishiyama 2021-04-26 09:05:53 +09:00
parent 9f1deb0c36
commit a480919ec3

View File

@ -608,8 +608,15 @@ async function saveFlows(flows, user) {
var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode; var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode;
if (workflowMode === 'auto') { if (workflowMode === 'auto') {
return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => { return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => {
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"}) return activeProject.commit(user,{message:"Update flow files"})
}) });
});
} }
} }
}); });