diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-05-18 17:22:41 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-05-18 17:22:41 +0300 |
commit | 6319ca271cd8de4595af136542b79367f28d211f (patch) | |
tree | c2cc11ee3a0014628b1eac9b8ad4d2dbeb7b5777 /app/models | |
parent | 4d2d2b11796fbf6f115b5e427794ec1c8126b2a0 (diff) | |
parent | 925945f01b1dcaf7b288afd7be53175a04eaecad (diff) |
Merge branch 'gitaly-local-branches' into 'master'
Incorporate Gitaly's local_branches operation into repo code
Closes #27379
See merge request !10059
Diffstat (limited to 'app/models')
-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) |