Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-05-18 17:22:41 +0300
committerDouwe Maan <douwe@gitlab.com>2017-05-18 17:22:41 +0300
commit6319ca271cd8de4595af136542b79367f28d211f (patch)
treec2cc11ee3a0014628b1eac9b8ad4d2dbeb7b5777 /app/models
parent4d2d2b11796fbf6f115b5e427794ec1c8126b2a0 (diff)
parent925945f01b1dcaf7b288afd7be53175a04eaecad (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.rb16
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)