summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-08-15 14:17:44 +0100
committerPhil Hughes <me@iamphill.com>2018-08-15 14:17:44 +0100
commit177a5e69b6d7a5425f4869d200dccf6612890a74 (patch)
treef3ea385f8405fdf824a57b753b14b24eca80a68a /app/assets/javascripts
parent7ff0dbc54f6d544e83e794d573704d4f49f5a921 (diff)
downloadgitlab-ce-ide-delete-new-files-state.tar.gz
Fixed deleting new files creating wrong state in IDEide-delete-new-files-state
Closes #50255
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/ide/stores/mutations.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/ide/stores/mutations.js b/app/assets/javascripts/ide/stores/mutations.js
index 1eda5768709..56a8d9430c7 100644
--- a/app/assets/javascripts/ide/stores/mutations.js
+++ b/app/assets/javascripts/ide/stores/mutations.js
@@ -200,6 +200,7 @@ export default {
},
[types.DELETE_ENTRY](state, path) {
const entry = state.entries[path];
+ const { tempFile = false } = entry;
const parent = entry.parentPath
? state.entries[entry.parentPath]
: state.trees[`${state.currentProjectId}/${state.currentBranchId}`];
@@ -209,7 +210,11 @@ export default {
parent.tree = parent.tree.filter(f => f.path !== entry.path);
if (entry.type === 'blob') {
- state.changedFiles = state.changedFiles.concat(entry);
+ if (tempFile) {
+ state.changedFiles = state.changedFiles.filter(f => f.path !== path);
+ } else {
+ state.changedFiles = state.changedFiles.concat(entry);
+ }
}
},
[types.RENAME_ENTRY](state, { path, name, entryPath = null }) {