diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-07-25 15:07:29 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-07-25 15:07:29 +0300 |
commit | 8ce5b4f1a30c0ab904f67c544a6b7de1bb49e664 (patch) | |
tree | fc9625d19726506d7d459327ec972071e6a3175a /app/models/repository.rb | |
parent | 83180110348af1b244d56e9cdf5f29c5d6f84db0 (diff) | |
parent | 850813d29867aac5935e1128880784f97071a6d8 (diff) |
Merge branch 'filter-branch-by-name' into 'master'
Users can filter branches by name on project branches page
This MR aims to solve #18674 by adding the possibility to filter project branches by name
![Screen_Shot_2016-07-07_at_17.21.25](/uploads/b674765d2b1cb8a121c2101715a4568b/Screen_Shot_2016-07-07_at_17.21.25.png)
See merge request !5144
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 793b1cf4989..69d71b7f96f 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -610,6 +610,8 @@ class Repository # Remove archives older than 2 hours def branches_sorted_by(value) case value + when 'name' + branches.sort_by(&:name) when 'recently_updated' branches.sort do |a, b| commit(b.target).committed_date <=> commit(a.target).committed_date |