summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repo/services/repo_service.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/repo/services/repo_service.js')
-rw-r--r--app/assets/javascripts/repo/services/repo_service.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/app/assets/javascripts/repo/services/repo_service.js b/app/assets/javascripts/repo/services/repo_service.js
index fbc24062140..3cf204e6ec8 100644
--- a/app/assets/javascripts/repo/services/repo_service.js
+++ b/app/assets/javascripts/repo/services/repo_service.js
@@ -13,16 +13,6 @@ const RepoService = {
},
richExtensionRegExp: /md/,
- checkCurrentBranchIsCommitable() {
- const url = Store.service.refsUrl;
- return axios.get(url, {
- params: {
- ref: Store.currentBranch,
- search: Store.currentBranch,
- },
- });
- },
-
getRaw(url) {
return axios.get(url, {
// Stop Axios from parsing a JSON file into a JS object
@@ -77,7 +67,11 @@ const RepoService = {
commitFiles(payload, cb) {
Api.commitMultiple(Store.projectId, payload, (data) => {
- Flash(`Your changes have been committed. Commit ${data.short_id} with ${data.stats.additions} additions, ${data.stats.deletions} deletions.`, 'notice');
+ if (data.short_id && data.stats) {
+ Flash(`Your changes have been committed. Commit ${data.short_id} with ${data.stats.additions} additions, ${data.stats.deletions} deletions.`, 'notice');
+ } else {
+ Flash(data.message);
+ }
cb();
});
},