From 4a0afc7ce70e8e6eb8d31b5c41164ff4e267f458 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 24 Jun 2013 18:28:56 +0400 Subject: [PATCH] GitRepoInfo: include currentRevision and state into equals & hashcode --- plugins/git4idea/src/git4idea/repo/GitRepoInfo.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/repo/GitRepoInfo.java b/plugins/git4idea/src/git4idea/repo/GitRepoInfo.java index ea774663488d..5e71115b5aa3 100644 --- a/plugins/git4idea/src/git4idea/repo/GitRepoInfo.java +++ b/plugins/git4idea/src/git4idea/repo/GitRepoInfo.java @@ -90,11 +90,13 @@ public class GitRepoInfo { GitRepoInfo info = (GitRepoInfo)o; - if (!myBranchTrackInfos.equals(info.myBranchTrackInfos)) return false; + if (myState != info.myState) return false; + if (myCurrentRevision != null ? !myCurrentRevision.equals(info.myCurrentRevision) : info.myCurrentRevision != null) return false; if (myCurrentBranch != null ? !myCurrentBranch.equals(info.myCurrentBranch) : info.myCurrentBranch != null) return false; + if (!myRemotes.equals(info.myRemotes)) return false; + if (!myBranchTrackInfos.equals(info.myBranchTrackInfos)) return false; if (!myLocalBranches.equals(info.myLocalBranches)) return false; if (!myRemoteBranches.equals(info.myRemoteBranches)) return false; - if (!myRemotes.equals(info.myRemotes)) return false; return true; } @@ -102,6 +104,8 @@ public class GitRepoInfo { @Override public int hashCode() { int result = myCurrentBranch != null ? myCurrentBranch.hashCode() : 0; + result = 31 * result + (myCurrentRevision != null ? myCurrentRevision.hashCode() : 0); + result = 31 * result + myState.hashCode(); result = 31 * result + myRemotes.hashCode(); result = 31 * result + myLocalBranches.hashCode(); result = 31 * result + myRemoteBranches.hashCode();