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
64a41655
Commit
64a41655
authored
May 03, 2021
by
Vasilii Iakliushin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend branch support for Static Site Editor
Allow to use both `main` and `master` branches Changelog: changed
parent
2df8eb00
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
changelogs/unreleased/extend_branch_support_for_sse.yml
changelogs/unreleased/extend_branch_support_for_sse.yml
+5
-0
lib/gitlab/static_site_editor/config/generated_config.rb
lib/gitlab/static_site_editor/config/generated_config.rb
+3
-3
spec/lib/gitlab/static_site_editor/config/generated_config_spec.rb
...gitlab/static_site_editor/config/generated_config_spec.rb
+4
-3
No files found.
changelogs/unreleased/extend_branch_support_for_sse.yml
0 → 100644
View file @
64a41655
---
title
:
Extend branch support for Static Site Editor
merge_request
:
60848
author
:
type
:
changed
lib/gitlab/static_site_editor/config/generated_config.rb
View file @
64a41655
...
...
@@ -42,11 +42,11 @@ module Gitlab
end
def
supported_content?
master_branch
?
&&
extension_supported?
&&
file_exists?
branch_supported
?
&&
extension_supported?
&&
file_exists?
end
def
master_branch
?
ref
==
'master'
def
branch_supported
?
ref
.
in?
(
%w[master main]
)
end
def
extension_supported?
...
...
spec/lib/gitlab/static_site_editor/config/generated_config_spec.rb
View file @
64a41655
...
...
@@ -54,13 +54,14 @@ RSpec.describe Gitlab::StaticSiteEditor::Config::GeneratedConfig do
path
,
''
,
message:
'message'
,
branch_name:
'master'
branch_name:
ref
)
end
let
(
:ref
)
{
'main'
}
let
(
:path
)
{
'README.md.erb'
}
it
{
is_expected
.
to
include
(
is_supported_content:
true
)
}
it
{
is_expected
.
to
include
(
branch:
ref
,
is_supported_content:
true
)
}
end
context
'when file path is nested'
do
...
...
@@ -69,7 +70,7 @@ RSpec.describe Gitlab::StaticSiteEditor::Config::GeneratedConfig do
it
{
is_expected
.
to
include
(
base_url:
'/namespace/project/-/sse/master%2Flib%2FREADME.md'
)
}
end
context
'when branch is not master'
do
context
'when branch is not master
or main
'
do
let
(
:ref
)
{
'my-branch'
}
it
{
is_expected
.
to
include
(
is_supported_content:
false
)
}
...
...
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