diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-16 12:08:32 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-16 12:08:32 +0000 |
commit | c158fa8d69c704663d289341a014c44c062cda88 (patch) | |
tree | d0cac82a9ac9e9ad28bb0030266eb8d5dc91fbbc /app/assets/javascripts/ide/stores/actions | |
parent | b806264d29b8d52ccb78a41dcc3d67f2b040700c (diff) | |
download | gitlab-ce-c158fa8d69c704663d289341a014c44c062cda88.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide/stores/actions')
-rw-r--r-- | app/assets/javascripts/ide/stores/actions/file.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js index 1bfee7b6be4..70a966afa66 100644 --- a/app/assets/javascripts/ide/stores/actions/file.js +++ b/app/assets/javascripts/ide/stores/actions/file.js @@ -147,7 +147,7 @@ export const getRawFileData = ({ state, commit, dispatch, getters }, { path }) = }); }; -export const changeFileContent = ({ commit, dispatch, state }, { path, content }) => { +export const changeFileContent = ({ commit, dispatch, state, getters }, { path, content }) => { const file = state.entries[path]; commit(types.UPDATE_FILE_CONTENT, { path, @@ -157,7 +157,9 @@ export const changeFileContent = ({ commit, dispatch, state }, { path, content } const indexOfChangedFile = state.changedFiles.findIndex(f => f.path === path); if (file.changed && indexOfChangedFile === -1) { - commit(types.ADD_FILE_TO_CHANGED, path); + if (gon.features?.stageAllByDefault) + commit(types.STAGE_CHANGE, { path, diffInfo: getters.getDiffInfo(path) }); + else commit(types.ADD_FILE_TO_CHANGED, path); } else if (!file.changed && !file.tempFile && indexOfChangedFile !== -1) { commit(types.REMOVE_FILE_FROM_CHANGED, path); } |