summaryrefslogtreecommitdiff
path: root/app/controllers/projects/application_controller.rb
diff options
context:
space:
mode:
authorJacopo <beschi.jacopo@gmail.com>2017-03-14 07:29:49 +0100
committerjacopo-beschi-intersail <jacopo.beschi@intersail.it>2017-03-21 11:51:53 +0100
commit7b04b63eeb8e3d6730acec3045a54f95968b3dac (patch)
treeee8214a00a882236d7bb2756553354fc024d9c59 /app/controllers/projects/application_controller.rb
parent0eff4f14ccae7d979e6fa20f0bb875e4591351e8 (diff)
downloadgitlab-ce-7b04b63eeb8e3d6730acec3045a54f95968b3dac.tar.gz
New directory from interface on existing branch
The user can create a new directory on a different branch than the source branch when the branch already exists.
Diffstat (limited to 'app/controllers/projects/application_controller.rb')
-rw-r--r--app/controllers/projects/application_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index e2f81b09adc..f1a93ccb3ad 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -89,4 +89,9 @@ class Projects::ApplicationController < ApplicationController
def builds_enabled
return render_404 unless @project.feature_available?(:builds, current_user)
end
+
+ def update_ref
+ branch_exists = @repository.find_branch(@target_branch)
+ @ref = @target_branch if branch_exists
+ end
end