diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-05-02 14:43:50 -0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2017-05-03 13:42:55 -0500 |
commit | 43c3967323b0b91e9843e7cdc79b2c21c949047b (patch) | |
tree | 4101ee01da681af258c3092a87d76ff241a61b6f | |
parent | 836854a0acbeac3a06a3f8c635c6e4429d0c1fa2 (diff) | |
download | gitlab-ce-43c3967323b0b91e9843e7cdc79b2c21c949047b.tar.gz |
Use branch_name over @branch.name to keep code concise
-rw-r--r-- | app/controllers/projects/branches_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 99f38f7584a..f0f031303d8 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -53,17 +53,17 @@ class Projects::BranchesController < Projects::ApplicationController redirect_to url_to_autodeploy_setup(project, branch_name), notice: view_context.autodeploy_flash_notice(branch_name) else - redirect_to namespace_project_tree_path(@project.namespace, @project, @branch.name) + redirect_to namespace_project_tree_path(@project.namespace, @project, branch_name) end else @error = result[:message] render action: 'new' - end + end end format.json do if result[:status] == :success - render json: { name: @branch.name, url: namespace_project_tree_url(@project.namespace, @project, @branch.name) } + render json: { name: branch_name, url: namespace_project_tree_url(@project.namespace, @project, branch_name) } else render json: result[:messsage], status: :unprocessable_entity end |