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:
authorMateusz Bajorski <ematib@gmail.com>2017-12-26 14:53:42 +0300
committerMateusz Bajorski <ematib@gmail.com>2017-12-26 21:29:54 +0300
commit896b9a6828b798ce796e0697cfa878c39c7ef829 (patch)
tree6b39675698accc2e162445699b4bdc5d03e30fcd /app/controllers/projects/branches_controller.rb
parent29749f92b7f86d45af41509262601e47ee848d92 (diff)
Fix when branch creation fails don't post system note
Closes #24347
Diffstat (limited to 'app/controllers/projects/branches_controller.rb')
-rw-r--r--app/controllers/projects/branches_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index 56df9991fda..e8e9f45edee 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -46,7 +46,7 @@ class Projects::BranchesController < Projects::ApplicationController
result = CreateBranchService.new(project, current_user)
.execute(branch_name, ref)
- if params[:issue_iid]
+ if params[:issue_iid] && result[:status] == :success
issue = IssuesFinder.new(current_user, project_id: @project.id).find_by(iid: params[:issue_iid])
SystemNoteService.new_issue_branch(issue, @project, current_user, branch_name) if issue
end