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
59154779
Commit
59154779
authored
6 years ago
by
Hiroyuki Sato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The json keys of ref switcher should not be translated
parent
7a633e08
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-2
changelogs/unreleased/48100-fix-branch-not-shown.yml
changelogs/unreleased/48100-fix-branch-not-shown.yml
+6
-0
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+16
-0
No files found.
app/controllers/projects_controller.rb
View file @
59154779
...
...
@@ -247,13 +247,13 @@ class ProjectsController < Projects::ApplicationController
if
find_branches
branches
=
BranchesFinder
.
new
(
@repository
,
params
).
execute
.
take
(
100
).
map
(
&
:name
)
options
[
s_
(
'RefSwitcher|Branches'
)
]
=
branches
options
[
'Branches'
]
=
branches
end
if
find_tags
&&
@repository
.
tag_count
.
nonzero?
tags
=
TagsFinder
.
new
(
@repository
,
params
).
execute
.
take
(
100
).
map
(
&
:name
)
options
[
s_
(
'RefSwitcher|Tags'
)
]
=
tags
options
[
'Tags'
]
=
tags
end
# If reference is commit id - we should add it to branch/tag selectbox
...
...
This diff is collapsed.
Click to expand it.
changelogs/unreleased/48100-fix-branch-not-shown.yml
0 → 100644
View file @
59154779
---
title
:
Fix branches are not shown in Merge Request dropdown when preferred language
is not English
merge_request
:
20016
author
:
Hiroyuki Sato
type
:
fixed
This diff is collapsed.
Click to expand it.
spec/controllers/projects_controller_spec.rb
View file @
59154779
...
...
@@ -597,6 +597,22 @@ describe ProjectsController do
expect
(
parsed_body
[
"Tags"
]).
to
include
(
"v1.0.0"
)
expect
(
parsed_body
[
"Commits"
]).
to
include
(
"123456"
)
end
context
"when preferred language is Japanese"
do
before
do
user
.
update!
(
preferred_language:
'ja'
)
sign_in
(
user
)
end
it
"gets a list of branches, tags and commits"
do
get
:refs
,
namespace_id:
public_project
.
namespace
,
id:
public_project
,
ref:
"123456"
parsed_body
=
JSON
.
parse
(
response
.
body
)
expect
(
parsed_body
[
"Branches"
]).
to
include
(
"master"
)
expect
(
parsed_body
[
"Tags"
]).
to
include
(
"v1.0.0"
)
expect
(
parsed_body
[
"Commits"
]).
to
include
(
"123456"
)
end
end
end
describe
'POST #preview_markdown'
do
...
...
This diff is collapsed.
Click to expand it.
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