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
77abcc60
Commit
77abcc60
authored
Jun 30, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix geo_primary_ssh_url_to_repo to append .git correctly
parent
b99e3ca2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
app/helpers/ee/gitlab_routing_helper.rb
app/helpers/ee/gitlab_routing_helper.rb
+1
-1
spec/helpers/ee/gitlab_routing_helper_spec.rb
spec/helpers/ee/gitlab_routing_helper_spec.rb
+27
-0
No files found.
app/helpers/ee/gitlab_routing_helper.rb
View file @
77abcc60
...
...
@@ -8,7 +8,7 @@ module EE
end
def
geo_primary_ssh_url_to_repo
(
project
)
"
#{
::
Gitlab
::
Geo
.
primary_node
.
clone_url_prefix
}#{
project
.
path_with_namespace
}
"
"
#{
::
Gitlab
::
Geo
.
primary_node
.
clone_url_prefix
}#{
project
.
path_with_namespace
}
.git
"
end
def
geo_primary_http_url_to_repo
(
project
)
...
...
spec/helpers/ee/gitlab_routing_helper_spec.rb
View file @
77abcc60
...
...
@@ -36,4 +36,31 @@ describe EE::GitlabRoutingHelper do
expect
(
result
).
to
eq
(
helper
.
geo_primary_ssh_url_to_repo
(
project
))
end
end
describe
'#geo_primary_http_url_to_repo'
do
context
'when using http protocol'
do
it
'returns a url in format http://hostname/namespace/repo.git'
do
result
=
helper
.
geo_primary_http_url_to_repo
(
project
)
expect
(
result
).
to
eq
(
"http://localhost/
#{
project
.
full_path
}
.git"
)
end
end
context
'when using https protocol'
do
it
'returns a url in format https://hostname/namespace/repo.git'
do
primary_node
.
update_attributes
(
schema:
'https'
,
port:
443
)
result
=
helper
.
geo_primary_http_url_to_repo
(
project
)
expect
(
result
).
to
eq
(
"https://localhost/
#{
project
.
full_path
}
.git"
)
end
end
end
describe
'#geo_primary_ssh_url_to_repo'
do
it
'returns a url in format user@host:namespace/repo.git'
do
result
=
helper
.
geo_primary_ssh_url_to_repo
(
project
)
expect
(
result
).
to
eq
(
"git@localhost:
#{
project
.
full_path
}
.git"
)
end
end
end
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