diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 09:07:49 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 09:07:49 +0000 |
commit | 0ba3a054d2190094ffda1ebe3aa53ffc5b92247d (patch) | |
tree | 8462503456eb030bb1042c6af73edc8f8af49fc6 /app/assets/javascripts/ide | |
parent | b24ae1cbc66e5b0f622393bcf2c59711750161ea (diff) | |
download | gitlab-ce-0ba3a054d2190094ffda1ebe3aa53ffc5b92247d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide')
-rw-r--r-- | app/assets/javascripts/ide/stores/actions/file.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/ide/stores/mutations/file.js | 8 |
2 files changed, 2 insertions, 7 deletions
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) { |