diff options
author | Robert Speicher <robert@gitlab.com> | 2018-02-22 03:20:31 +0300 |
---|---|---|
committer | Ian Baum <ibaum@gitlab.com> | 2018-02-23 23:02:36 +0300 |
commit | a5556f8cd3bf01300b334befa0c52987fdb75240 (patch) | |
tree | 6c13200ab19cde8be373a968beec62daa5c8d731 /lib | |
parent | fd6018b9144c7c3154a8854373aed97c933c2085 (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.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/git_access_wiki.rb | 6 |
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 |