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
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-02-22 03:20:31 +0300
committerIan Baum <ibaum@gitlab.com>2018-02-23 23:02:36 +0300
commita5556f8cd3bf01300b334befa0c52987fdb75240 (patch)
tree6c13200ab19cde8be373a968beec62daa5c8d731 /lib
parentfd6018b9144c7c3154a8854373aed97c933c2085 (diff)
Merge branch 'git-access-existence-check' into 'master'
Fix repo existence check in GitAccessWiki Closes #43385 and gitlab-com/infrastructure#3734 See merge request gitlab-org/gitlab-ce!17268
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git_access.rb6
-rw-r--r--lib/gitlab/git_access_wiki.rb6
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index 9ec3858b493..bbdb593d4e2 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -198,7 +198,7 @@ module Gitlab
end
def check_repository_existence!
- unless project.repository.exists?
+ unless repository.exists?
raise UnauthorizedError, ERROR_MESSAGES[:no_repo]
end
end
@@ -327,5 +327,9 @@ module Gitlab
def push_to_read_only_message
ERROR_MESSAGES[:cannot_push_to_read_only]
end
+
+ def repository
+ project.repository
+ end
end
end
diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb
index 84d6e1490c3..a5b3902ebf4 100644
--- a/lib/gitlab/git_access_wiki.rb
+++ b/lib/gitlab/git_access_wiki.rb
@@ -28,5 +28,11 @@ module Gitlab
def push_to_read_only_message
ERROR_MESSAGES[:read_only]
end
+
+ private
+
+ def repository
+ project.wiki.repository
+ end
end
end