Commit ecbf3707 authored by Robert May's avatar Robert May

Use existing hash for cache key

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