diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-01-31 13:03:13 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-02-07 17:07:03 +0300 |
commit | 73e78c4e1517dd50bd5dd0934e0f62288de2971b (patch) | |
tree | 599369eec818e11c5a8131a6912a9e6d63575507 /app/helpers/graph_helper.rb | |
parent | 86342966a1b61d30dca019e983235aadc14a36ef (diff) |
Don't use rugged in Repository#refs_hash
The refs hash is used to determine what branches and tags have a commit
as head in the network graph. The previous implementation depended on
Rugged#references. The problem with this implementation was that it
depended on rugged, but also that it iterated over all references and
thus loading more data than needed if for example the project uses CI/CD
environments, Pipelines, or Merge Requests.
Given only refs are checked the network cares about the GraphHelper#refs
method has no need to reject those, simplifying the method.
Closes gitlab-org/gitaly#880
Diffstat (limited to 'app/helpers/graph_helper.rb')
-rw-r--r-- | app/helpers/graph_helper.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/helpers/graph_helper.rb b/app/helpers/graph_helper.rb index 6d303ba857d..1022070ab6f 100644 --- a/app/helpers/graph_helper.rb +++ b/app/helpers/graph_helper.rb @@ -1,10 +1,6 @@ module GraphHelper - def get_refs(repo, commit) - refs = "" - # Commit::ref_names already strips the refs/XXX from important refs (e.g. refs/heads/XXX) - # so anything leftover is internally used by GitLab - commit_refs = commit.ref_names(repo).reject { |name| name.starts_with?('refs/') } - refs << commit_refs.join(' ') + def refs(repo, commit) + refs = commit.ref_names(repo).join(' ') # append note count notes_count = @graph.notes[commit.id] |