Skip to content

Commit adb61a9

Browse files
author
Vladimir Kotal
committed
strip leading and trailing whitespace when comparing messages
1 parent ee1be79 commit adb61a9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/HistoryEntry.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,19 @@ public boolean equals(Object o) {
233233
}
234234
HistoryEntry that = (HistoryEntry) o;
235235

236+
String thisMessage = this.getMessage();
237+
if (thisMessage != null) {
238+
thisMessage = thisMessage.stripLeading().stripTrailing();
239+
}
240+
String thatMessage = that.getMessage();
241+
if (thatMessage != null) {
242+
thatMessage = thatMessage.stripLeading().stripTrailing();
243+
}
244+
236245
return checkEquals(this.getAuthor(), that.getAuthor()) &&
237246
checkEquals(this.getRevision(), that.getRevision()) &&
238247
checkEquals(this.getDate(), that.getDate()) &&
239-
checkEquals(this.getMessage(), that.getMessage()) &&
248+
checkEquals(thisMessage, thatMessage) &&
240249
checkEquals(this.getFiles(), that.getFiles()) &&
241250
checkEquals(this.getTags(), that.getTags());
242251
}

0 commit comments

Comments
 (0)