Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
740165a0
Commit
740165a0
authored
Dec 04, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add primary push message logic
parent
7afa3f47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+13
-1
No files found.
lib/gitlab/git_access.rb
View file @
740165a0
...
...
@@ -10,6 +10,17 @@ module Gitlab
NotFoundError
=
Class
.
new
(
StandardError
)
ProjectMovedError
=
Class
.
new
(
NotFoundError
)
def
self
.
push_to_read_only_message
message
=
"You can't push code to a read-only GitLab instance."
if
Gitlab
::
Geo
.
primary_node
primary_url
=
ActionController
::
Base
.
helpers
.
link_to
(
'primary node'
,
Gitlab
::
Geo
.
primary_node
.
url
)
message
+=
"Please use the Primary node
#{
primary_url
.
html_safe
}
. See the documentation for more information:
#{
GEO_SERVER_DOCS_URL
}
"
end
message
end
ERROR_MESSAGES
=
{
upload:
'You are not allowed to upload code for this project.'
,
download:
'You are not allowed to download code from this project.'
,
...
...
@@ -22,9 +33,10 @@ module Gitlab
upload_pack_disabled_over_http:
'Pulling over HTTP is not allowed.'
,
receive_pack_disabled_over_http:
'Pushing over HTTP is not allowed.'
,
read_only:
'The repository is temporarily read-only. Please try again later.'
,
cannot_push_to_read_only:
"You can't push code to a read-only GitLab instance."
cannot_push_to_read_only:
push_to_read_only_message
}.
freeze
GEO_SERVER_DOCS_URL
=
'https://docs.gitlab.com/ee/gitlab-geo/using_a_geo_server.html'
DOWNLOAD_COMMANDS
=
%w{ git-upload-pack git-upload-archive }
.
freeze
PUSH_COMMANDS
=
%w{ git-receive-pack }
.
freeze
ALL_COMMANDS
=
DOWNLOAD_COMMANDS
+
PUSH_COMMANDS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment