summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-01-31 11:03:13 +0100
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-02-07 15:07:03 +0100
commit73e78c4e1517dd50bd5dd0934e0f62288de2971b (patch)
tree599369eec818e11c5a8131a6912a9e6d63575507 /spec/helpers
parent86342966a1b61d30dca019e983235aadc14a36ef (diff)
downloadgitlab-ce-73e78c4e1517dd50bd5dd0934e0f62288de2971b.tar.gz
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 'spec/helpers')
-rw-r--r--spec/helpers/graph_helper_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/helpers/graph_helper_spec.rb b/spec/helpers/graph_helper_spec.rb
index 400635abdde..1f8a38dc697 100644
--- a/spec/helpers/graph_helper_spec.rb
+++ b/spec/helpers/graph_helper_spec.rb
@@ -7,10 +7,10 @@ describe GraphHelper do
let(:graph) { Network::Graph.new(project, 'master', commit, '') }
it 'filters our refs used by GitLab' do
- allow(commit).to receive(:ref_names).and_return(['refs/merge-requests/abc', 'master', 'refs/tmp/xyz'])
self.instance_variable_set(:@graph, graph)
- refs = get_refs(project.repository, commit)
- expect(refs).to eq('master')
+ refs = refs(project.repository, commit)
+
+ expect(refs).to match('master')
end
end
end