Commit ecbf3707 authored by Robert May's avatar Robert May

Use existing hash for cache key

parent 80dec92a
...@@ -26,7 +26,7 @@ class Compare ...@@ -26,7 +26,7 @@ class Compare
end end
def cache_key def cache_key
[@project, :compare, start_commit_sha, base_commit_sha, head_commit_sha, @straight] [@project, :compare, diff_refs.hash]
end end
def commits def commits
......
...@@ -19,9 +19,8 @@ RSpec.describe Compare do ...@@ -19,9 +19,8 @@ RSpec.describe Compare do
subject { compare.cache_key } subject { compare.cache_key }
it { is_expected.to include(project) } it { is_expected.to include(project) }
it { is_expected.to include(start_commit.id) } it { is_expected.to include(:compare) }
it { is_expected.to include(head_commit.id) } it { is_expected.to include(compare.diff_refs.hash) }
it { is_expected.to include(compare.base_commit_sha) }
end end
describe '#start_commit' do describe '#start_commit' do
......
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