diff --git a/app/assets/javascripts/ide/stores/mutations.js b/app/assets/javascripts/ide/stores/mutations.js index a8b0aad25fa..bc6e23fc386 100644 --- a/app/assets/javascripts/ide/stores/mutations.js +++ b/app/assets/javascripts/ide/stores/mutations.js @@ -199,7 +199,7 @@ export default { entry.deleted = true; - parent.tree.splice(parent.tree.findIndex(f => f.path === entry.path), 1); + parent.tree = parent.tree.filter(f => f.path !== entry.path); if (entry.type === 'blob') { state.changedFiles = state.changedFiles.concat(entry); diff --git a/app/assets/javascripts/ide/stores/utils.js b/app/assets/javascripts/ide/stores/utils.js index 6d4941e9c32..fba1f70bf6c 100644 --- a/app/assets/javascripts/ide/stores/utils.js +++ b/app/assets/javascripts/ide/stores/utils.js @@ -121,17 +121,12 @@ export const commitActionForFile = file => { return 'update'; }; -export const getCommitFiles = (stagedFiles, deleteTree = false) => +export const getCommitFiles = stagedFiles => stagedFiles.reduce((acc, file) => { if (file.moved) return acc; - if ((file.deleted || deleteTree || file.prevPath) && file.type === 'tree') { - return acc.concat(getCommitFiles(file.tree, true)); - } - return acc.concat({ ...file, - deleted: deleteTree || file.deleted, }); }, []);