Commit d780b8ba authored by Matthias Käppler's avatar Matthias Käppler

Merge branch 'further-tags-improvements' into 'master'

Minor memory usage improvements on tags

See merge request gitlab-org/gitlab!60641
parents 3bd38acc 2c1d5d12
...@@ -1165,17 +1165,13 @@ class Repository ...@@ -1165,17 +1165,13 @@ class Repository
end end
def tags_sorted_by_committed_date def tags_sorted_by_committed_date
tags.sort_by do |tag| # Annotated tags can point to any object (e.g. a blob), but generally
# Annotated tags can point to any object (e.g. a blob), but generally # tags point to a commit. If we don't have a commit, then just default
# tags point to a commit. If we don't have a commit, then just default # to putting the tag at the end of the list.
# to putting the tag at the end of the list. default = Time.current
target = tag.dereferenced_target
if target tags.sort_by do |tag|
target.committed_date tag.dereferenced_target&.committed_date || default
else
Time.current
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment