diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-03-17 16:36:46 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-05-17 18:12:10 -0400 |
commit | 925945f01b1dcaf7b288afd7be53175a04eaecad (patch) | |
tree | a6c164900b11cf7829f8c787d0a0c10d7002c78b /app | |
parent | 71569a9c410d297469c86227807c9f60cc069ef6 (diff) | |
download | gitlab-ce-925945f01b1dcaf7b288afd7be53175a04eaecad.tar.gz |
Incorporate Gitaly's local_branches operation into repo codegitaly-local-branches
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository.rb | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 9153e5ae5a8..07e0b3bae4f 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -649,22 +649,8 @@ class Repository "#{name}-#{highest_branch_id + 1}" end - # Remove archives older than 2 hours def branches_sorted_by(value) - case value - when 'name' - branches.sort_by(&:name) - when 'updated_desc' - branches.sort do |a, b| - commit(b.dereferenced_target).committed_date <=> commit(a.dereferenced_target).committed_date - end - when 'updated_asc' - branches.sort do |a, b| - commit(a.dereferenced_target).committed_date <=> commit(b.dereferenced_target).committed_date - end - else - branches - end + raw_repository.local_branches(sort_by: value) end def tags_sorted_by(value) |