Skip to content
Snippets Groups Projects
Commit 71569a9c authored by Alejandro Rodríguez's avatar Alejandro Rodríguez
Browse files

Compare ids of commits if present for equality test

This solves a problem where commits populated with Gitaly were not equal
to commits populated with Rugged. This is because Gitaly may not return
all fields of a commit for optimizations purposes, which resulted in
false negatives when comparing the same commit (commits with the same
sha) with different sources.
parent f3cbb0a4
No related branches found
No related tags found
2 merge requests!12073Add RC2 changes to 9-3-stable,!10059Incorporate Gitaly's local_branches operation into repo code
Loading
Loading
@@ -19,13 +19,7 @@ module Gitlab
def ==(other)
return false unless other.is_a?(Gitlab::Git::Commit)
 
methods = [:message, :parent_ids, :authored_date, :author_name,
:author_email, :committed_date, :committer_name,
:committer_email]
methods.all? do |method|
send(method) == other.send(method)
end
id && id == other.id
end
 
class << self
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment