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
6c5b6e62
Commit
6c5b6e62
authored
Jan 04, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
06c46d94
64c582d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
2 deletions
+46
-2
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+2
-2
changelogs/unreleased/sh-fix-clone-url-for-https.yml
changelogs/unreleased/sh-fix-clone-url-for-https.yml
+5
-0
spec/helpers/application_settings_helper_spec.rb
spec/helpers/application_settings_helper_spec.rb
+39
-0
No files found.
app/helpers/application_settings_helper.rb
View file @
6c5b6e62
...
...
@@ -20,7 +20,7 @@ module ApplicationSettingsHelper
def
enabled_protocol
case
Gitlab
::
CurrentSettings
.
enabled_git_access_protocol
when
'http'
gitlab_config
.
protocol
Gitlab
.
config
.
gitlab
.
protocol
when
'ssh'
'ssh'
end
...
...
@@ -35,7 +35,7 @@ module ApplicationSettingsHelper
end
def
http_enabled?
all_protocols_enabled?
||
enabled
_protocol
==
'http'
all_protocols_enabled?
||
Gitlab
::
CurrentSettings
.
enabled_git_access
_protocol
==
'http'
end
def
enabled_project_button
(
project
,
protocol
)
...
...
changelogs/unreleased/sh-fix-clone-url-for-https.yml
0 → 100644
View file @
6c5b6e62
---
title
:
Fix clone URL not showing if protocol is HTTPS
merge_request
:
24131
author
:
type
:
fixed
spec/helpers/application_settings_helper_spec.rb
0 → 100644
View file @
6c5b6e62
# frozen_string_literal: true
require
'spec_helper'
describe
ApplicationSettingsHelper
do
context
'when all protocols in use'
do
before
do
stub_application_setting
(
enabled_git_access_protocol:
''
)
end
it
{
expect
(
all_protocols_enabled?
).
to
be_truthy
}
it
{
expect
(
http_enabled?
).
to
be_truthy
}
it
{
expect
(
ssh_enabled?
).
to
be_truthy
}
end
context
'when SSH is only in use'
do
before
do
stub_application_setting
(
enabled_git_access_protocol:
'ssh'
)
end
it
{
expect
(
all_protocols_enabled?
).
to
be_falsey
}
it
{
expect
(
http_enabled?
).
to
be_falsey
}
it
{
expect
(
ssh_enabled?
).
to
be_truthy
}
end
shared_examples
'when HTTP protocol is in use'
do
|
protocol
|
before
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:protocol
).
and_return
(
protocol
)
stub_application_setting
(
enabled_git_access_protocol:
'http'
)
end
it
{
expect
(
all_protocols_enabled?
).
to
be_falsey
}
it
{
expect
(
http_enabled?
).
to
be_truthy
}
it
{
expect
(
ssh_enabled?
).
to
be_falsey
}
end
it_behaves_like
'when HTTP protocol is in use'
,
'https'
it_behaves_like
'when HTTP protocol is in use'
,
'http'
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