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
3e41ea46
Commit
3e41ea46
authored
Nov 25, 2020
by
Alan (Maciej) Paruszewski
Committed by
Heinrich Lee Yu
Nov 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle blank default branch in security configuration
parent
eb50a87b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
ee/app/presenters/projects/security/configuration_presenter.rb
...p/presenters/projects/security/configuration_presenter.rb
+1
-1
ee/changelogs/unreleased/handle-blank-default-branch-in-security-configuration.yml
...handle-blank-default-branch-in-security-configuration.yml
+5
-0
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
...senters/projects/security/configuration_presenter_spec.rb
+10
-0
No files found.
ee/app/presenters/projects/security/configuration_presenter.rb
View file @
3e41ea46
...
...
@@ -101,7 +101,7 @@ module Projects
return
''
if
project
.
empty_repo?
gitlab_ci
=
Gitlab
::
FileDetector
::
PATTERNS
[
:gitlab_ci
]
Gitlab
::
Routing
.
url_helpers
.
project_blame_path
(
project
,
File
.
join
(
project
.
default_branch
,
gitlab_ci
))
Gitlab
::
Routing
.
url_helpers
.
project_blame_path
(
project
,
File
.
join
(
project
.
default_branch
_or_master
,
gitlab_ci
))
end
def
features
...
...
ee/changelogs/unreleased/handle-blank-default-branch-in-security-configuration.yml
0 → 100644
View file @
3e41ea46
---
title
:
Use `master` when default branch is blank in security configuration
merge_request
:
48328
author
:
type
:
fixed
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
View file @
3e41ea46
...
...
@@ -50,6 +50,16 @@ RSpec.describe Projects::Security::ConfigurationPresenter do
end
end
context
'when the project has no default branch set'
do
before
do
allow
(
project
).
to
receive
(
:default_branch
).
and_return
(
nil
)
end
it
'includes the path to gitlab_ci history'
do
expect
(
subject
[
:gitlab_ci_history_path
]).
to
eq
(
project_blame_path
(
project
,
'master/.gitlab-ci.yml'
))
end
end
context
"when the latest default branch pipeline's source is auto devops"
do
before
do
pipeline
=
create
(
...
...
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