Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/projects/commit/store/mutations.js')
-rw-r--r--app/assets/javascripts/projects/commit/store/mutations.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/projects/commit/store/mutations.js b/app/assets/javascripts/projects/commit/store/mutations.js
new file mode 100644
index 00000000000..6add00deadb
--- /dev/null
+++ b/app/assets/javascripts/projects/commit/store/mutations.js
@@ -0,0 +1,25 @@
+import * as types from './mutation_types';
+
+export default {
+ [types.REQUEST_BRANCHES](state) {
+ state.isFetching = true;
+ },
+
+ [types.RECEIVE_BRANCHES_SUCCESS](state, branches) {
+ state.isFetching = false;
+ state.branches = branches;
+ state.branches.unshift(state.branch);
+ },
+
+ [types.CLEAR_MODAL](state) {
+ state.branch = state.defaultBranch;
+ },
+
+ [types.SET_BRANCH](state, branch) {
+ state.branch = branch;
+ },
+
+ [types.SET_SELECTED_BRANCH](state, branch) {
+ state.selectedBranch = branch;
+ },
+};