summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-10-31 15:00:30 +0000
committerDouwe Maan <douwe@gitlab.com>2016-10-31 15:00:30 +0000
commit1ff00cb2dd168d98b0d4f4995216ed909dae9349 (patch)
treee25fe417a3a01e0bd73145475869a73e25c8a062 /lib/api/internal.rb
parentdecf0fefe17a574782d47504920b9a2cfc7b14dc (diff)
parent490776517c394ced2780159fa3800e2accc27601 (diff)
downloadgitlab-ce-add-retry-limit-project-webhook.tar.gz
Merge branch 'master' into 'add-retry-limit-project-webhook'add-retry-limit-project-webhook
# Conflicts: # app/workers/project_web_hook_worker.rb
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r--lib/api/internal.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index 9a5d1ece070..ccf181402f9 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -17,15 +17,20 @@ module API
#
helpers do
+ def project_path
+ @project_path ||= begin
+ project_path = params[:project].sub(/\.git\z/, '')
+ Repository.remove_storage_from_path(project_path)
+ end
+ end
+
def wiki?
- @wiki ||= params[:project].end_with?('.wiki') &&
- !Project.find_with_namespace(params[:project])
+ @wiki ||= project_path.end_with?('.wiki') &&
+ !Project.find_with_namespace(project_path)
end
def project
@project ||= begin
- project_path = params[:project]
-
# Check for *.wiki repositories.
# Strip out the .wiki from the pathname before finding the
# project. This applies the correct project permissions to