From 0ba3a054d2190094ffda1ebe3aa53ffc5b92247d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 10 Jan 2020 09:07:49 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/ide/stores/actions/file.js | 1 + app/assets/javascripts/ide/stores/mutations/file.js | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js index d444f6be21d..cec4ce204f8 100644 --- a/app/assets/javascripts/ide/stores/actions/file.js +++ b/app/assets/javascripts/ide/stores/actions/file.js @@ -197,6 +197,7 @@ export const discardFileChanges = ({ dispatch, state, commit, getters }, path) = if (file.tempFile) { dispatch('deleteEntry', file.path); } else { + commit(types.DISCARD_FILE_CHANGES, file.path); dispatch('renameEntry', { path: file.path, name: file.prevName, diff --git a/app/assets/javascripts/ide/stores/mutations/file.js b/app/assets/javascripts/ide/stores/mutations/file.js index 1b126352330..73d03e57f54 100644 --- a/app/assets/javascripts/ide/stores/mutations/file.js +++ b/app/assets/javascripts/ide/stores/mutations/file.js @@ -132,7 +132,7 @@ export default { [types.DISCARD_FILE_CHANGES](state, path) { const stagedFile = state.stagedFiles.find(f => f.path === path); const entry = state.entries[path]; - const { deleted, prevPath } = entry; + const { deleted } = entry; Object.assign(state.entries[path], { content: stagedFile ? stagedFile.content : state.entries[path].raw, @@ -146,12 +146,6 @@ export default { : state.trees[`${state.currentProjectId}/${state.currentBranchId}`]; parent.tree = sortTree(parent.tree.concat(entry)); - } else if (prevPath) { - const parent = entry.parentPath - ? state.entries[entry.parentPath] - : state.trees[`${state.currentProjectId}/${state.currentBranchId}`]; - - parent.tree = parent.tree.filter(f => f.path !== path); } }, [types.ADD_FILE_TO_CHANGED](state, path) { -- cgit v1.2.1