From 38cd3d64514655c508eba980b7abc216ef2a1c0b Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 2 May 2015 22:41:37 -0400 Subject: [PATCH] Add Commit#== Prior, comparison would use the Ruby object's ID, which got out of sync after a Spring fork and would result in erroneous test failures. Now we just check that the compared object is a Commit and then compare their underlying raw commit objects. --- app/models/commit.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/commit.rb b/app/models/commit.rb index be5a118bfec..5dea7dda513 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -56,6 +56,10 @@ class Commit @raw.id end + def ==(other) + (self.class === other) && (raw == other.raw) + end + def diff_line_count @diff_line_count ||= Commit::diff_line_count(self.diffs) @diff_line_count