Add a PATCHSET_LEVEL to FilenameComparator
The PATCHSET_LEVEL is part of Patch class, but is missing from FilenameComparator.
This is needed, for example, when sorting comments for the email.
Change-Id: Ic01af68bee40115f63de3ffd7c53213e49c6041e
Google-Bug-Id: b/266904943
Release-Notes: skip
diff --git a/java/com/google/gerrit/common/data/FilenameComparator.java b/java/com/google/gerrit/common/data/FilenameComparator.java
index 0b188df..e1c763c0 100644
--- a/java/com/google/gerrit/common/data/FilenameComparator.java
+++ b/java/com/google/gerrit/common/data/FilenameComparator.java
@@ -30,6 +30,13 @@
@Override
public int compare(String path1, String path2) {
+ if (Patch.PATCHSET_LEVEL.equals(path1) && Patch.PATCHSET_LEVEL.equals(path2)) {
+ return 0;
+ } else if (Patch.PATCHSET_LEVEL.equals(path1)) {
+ return -1;
+ } else if (Patch.PATCHSET_LEVEL.equals(path2)) {
+ return 1;
+ }
if (Patch.COMMIT_MSG.equals(path1) && Patch.COMMIT_MSG.equals(path2)) {
return 0;
} else if (Patch.COMMIT_MSG.equals(path1)) {