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
1cf35c3d
Commit
1cf35c3d
authored
Oct 22, 2017
by
George Andrinopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add case insensitive branches search
parent
cc8af554
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
app/finders/branches_finder.rb
app/finders/branches_finder.rb
+1
-1
changelogs/unreleased/35199-case-insensitive-branches-search.yml
...ogs/unreleased/35199-case-insensitive-branches-search.yml
+5
-0
spec/finders/branches_finder_spec.rb
spec/finders/branches_finder_spec.rb
+9
-0
No files found.
app/finders/branches_finder.rb
View file @
1cf35c3d
...
...
@@ -23,7 +23,7 @@ class BranchesFinder
def
filter_by_name
(
branches
)
if
search
branches
.
select
{
|
branch
|
branch
.
name
.
include?
(
search
)
}
branches
.
select
{
|
branch
|
branch
.
name
.
upcase
.
include?
(
search
.
upcase
)
}
else
branches
end
...
...
changelogs/unreleased/35199-case-insensitive-branches-search.yml
0 → 100644
View file @
1cf35c3d
---
title
:
Case insensitive search for branches
merge_request
:
14995
author
:
George Andrinopoulos
type
:
fixed
spec/finders/branches_finder_spec.rb
View file @
1cf35c3d
...
...
@@ -46,6 +46,15 @@ describe BranchesFinder do
expect
(
result
.
count
).
to
eq
(
1
)
end
it
'filters branches by name ignoring letter case'
do
branches_finder
=
described_class
.
new
(
repository
,
{
search:
'FiX'
})
result
=
branches_finder
.
execute
expect
(
result
.
first
.
name
).
to
eq
(
'fix'
)
expect
(
result
.
count
).
to
eq
(
1
)
end
it
'does not find any branch with that name'
do
branches_finder
=
described_class
.
new
(
repository
,
{
search:
'random'
})
...
...
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