Skip to content

Allow shas that are nil to compare to nil shas

Alex Kalderimis requested to merge 13495-x-fix-sha-equality-semantics into master

What does this MR do?

This fixes equality of SHA1 hashes. Previously, shas_eql?(nil, nil) would return false, which breaks equality semantics for DiffRefs.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Git hashes are ubiquitous throughout GitLab - while it appears that this current behaviour is a bug (one that seldom appears since we seldom have nillable hashes), it is possible that this could break existing code. We need to be prepared to revert this if there are issues.

Found during work on #13495 (closed)

Merge request reports