git: let GitReference.compareTo conform equals()

Actually, GitReference objects shouldn't be comparable at all,
but their comparability is already used in many places,
and will be changed separately.
This commit is contained in:
Kirill Likhodedov
2016-04-02 19:19:07 +03:00
parent 81c5a4ed72
commit 608a48431b
@@ -15,6 +15,8 @@
*/
package git4idea;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.text.FilePathHashingStrategy;
import gnu.trove.TObjectHashingStrategy;
import org.jetbrains.annotations.NotNull;
@@ -66,6 +68,6 @@ public abstract class GitReference implements Comparable<GitReference> {
}
public int compareTo(GitReference o) {
return o == null ? 1 : getFullName().compareTo(o.getFullName());
return o == null ? 1 : StringUtil.compare(getFullName(), o.getFullName(), SystemInfo.isFileSystemCaseSensitive);
}
}