mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2957 from node-red-hitachi/fix-error-on-git-auto-commit
fix error on auto commit for no flow change
This commit is contained in:
commit
f5a1c8bc49
@ -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"})
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user