From f88f0629f488f91c5fe3ff2e65fc49bc87d079bc Mon Sep 17 00:00:00 2001
From: Julia Beliaeva
Date: Thu, 10 Dec 2015 20:56:10 +0300
Subject: [PATCH] [git] get rid of dummy hash: GitBranch does not have hash
anymore
---
plugins/git4idea/src/git4idea/GitBranch.java | 27 +++------
.../git4idea/src/git4idea/GitLocalBranch.java | 5 +-
.../src/git4idea/GitRemoteBranch.java | 5 +-
.../src/git4idea/GitStandardRemoteBranch.java | 10 +++-
.../src/git4idea/GitSvnRemoteBranch.java | 5 +-
plugins/git4idea/src/git4idea/GitUtil.java | 2 +-
.../src/git4idea/branch/GitBranchUtil.java | 6 +-
.../branch/GitBranchesCollection.java | 47 ++++++++++------
.../src/git4idea/log/GitLogProvider.java | 15 +++--
.../src/git4idea/push/GitPushSupport.java | 2 +-
.../src/git4idea/push/GitPushTarget.java | 2 +-
.../push/GitSpecialRefRemoteBranch.java | 3 +-
.../src/git4idea/rebase/GitRebaseDialog.java | 4 +-
.../src/git4idea/repo/GitBranchState.java | 15 ++---
.../src/git4idea/repo/GitRepoInfo.java | 56 +++++++++++--------
.../src/git4idea/repo/GitRepositoryImpl.java | 4 +-
.../git4idea/repo/GitRepositoryReader.java | 39 +++++++------
.../git4idea/push/GitPushOperationBaseTest.kt | 2 +-
.../push/GitPushResultNotificationTest.java | 4 +-
.../tests/git4idea/repo/GitConfigTest.java | 6 +-
.../repo/GitRepositoryReaderNewTest.java | 2 +-
.../repo/GitRepositoryReaderTest.java | 19 ++++---
22 files changed, 149 insertions(+), 131 deletions(-)
diff --git a/plugins/git4idea/src/git4idea/GitBranch.java b/plugins/git4idea/src/git4idea/GitBranch.java
index acdd45a7f050..c3058f7405cc 100644
--- a/plugins/git4idea/src/git4idea/GitBranch.java
+++ b/plugins/git4idea/src/git4idea/GitBranch.java
@@ -17,11 +17,11 @@ package git4idea;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.vcs.log.Hash;
-import com.intellij.vcs.log.impl.HashImpl;
import git4idea.branch.GitBranchUtil;
import git4idea.repo.GitRepository;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Represents a Git branch, local or remote.
@@ -44,30 +44,17 @@ public abstract class GitBranch extends GitReference {
@NonNls public static final String REFS_HEADS_PREFIX = "refs/heads/"; // Prefix for local branches ({@value})
@NonNls public static final String REFS_REMOTES_PREFIX = "refs/remotes/"; // Prefix for remote branches ({@value})
+ private static final Logger LOG = Logger.getInstance(GitBranch.class);
+
/**
* @deprecated All usages should be reviewed and substituted with actual GitBranch objects with Hashes retrieved from the GitRepository.
*/
@Deprecated
- public static final Hash DUMMY_HASH = HashImpl.build("");
+ @Nullable
+ public static final Hash DUMMY_HASH = null;
- private static final Logger LOG = Logger.getInstance(GitBranch.class);
-
- @NotNull private final Hash myHash;
-
- protected GitBranch(@NotNull String name, @NotNull Hash hash) {
+ protected GitBranch(@NotNull String name) {
super(GitBranchUtil.stripRefsPrefix(name));
- myHash = hash;
- }
-
- /**
- * Returns the hash on which this branch is reference to.
- *
- * In certain cases (which are to be eliminated in the future) it may be empty,
- * if this information wasn't supplied to the GitBranch constructor.
- */
- @NotNull
- public Hash getHash() {
- return myHash;
}
/**
@@ -121,7 +108,7 @@ public abstract class GitBranch extends GitReference {
@NotNull
public String toLogString() {
- return String.format("%s:%s:%s", getFullName(), getHash(), isRemote() ? "remote" : "local");
+ return String.format("%s:%s", getFullName(), isRemote() ? "remote" : "local");
}
}
diff --git a/plugins/git4idea/src/git4idea/GitLocalBranch.java b/plugins/git4idea/src/git4idea/GitLocalBranch.java
index 6996971c22c7..16c9feaa29be 100644
--- a/plugins/git4idea/src/git4idea/GitLocalBranch.java
+++ b/plugins/git4idea/src/git4idea/GitLocalBranch.java
@@ -15,7 +15,6 @@
*/
package git4idea;
-import com.intellij.vcs.log.Hash;
import git4idea.repo.GitBranchTrackInfo;
import git4idea.repo.GitRepository;
import org.jetbrains.annotations.NotNull;
@@ -26,8 +25,8 @@ import org.jetbrains.annotations.Nullable;
*/
public class GitLocalBranch extends GitBranch {
- public GitLocalBranch(@NotNull String name, @NotNull Hash hash) {
- super(name, hash);
+ public GitLocalBranch(@NotNull String name) {
+ super(name);
}
@Override
diff --git a/plugins/git4idea/src/git4idea/GitRemoteBranch.java b/plugins/git4idea/src/git4idea/GitRemoteBranch.java
index 36ddca4b29e5..a87bca59e38d 100644
--- a/plugins/git4idea/src/git4idea/GitRemoteBranch.java
+++ b/plugins/git4idea/src/git4idea/GitRemoteBranch.java
@@ -15,7 +15,6 @@
*/
package git4idea;
-import com.intellij.vcs.log.Hash;
import git4idea.repo.GitRemote;
import org.jetbrains.annotations.NotNull;
@@ -24,8 +23,8 @@ import org.jetbrains.annotations.NotNull;
*/
public abstract class GitRemoteBranch extends GitBranch {
- protected GitRemoteBranch(@NotNull String name, @NotNull Hash hash) {
- super(name, hash);
+ protected GitRemoteBranch(@NotNull String name) {
+ super(name);
}
/**
diff --git a/plugins/git4idea/src/git4idea/GitStandardRemoteBranch.java b/plugins/git4idea/src/git4idea/GitStandardRemoteBranch.java
index 180a40527e7f..bbdc797eb48a 100644
--- a/plugins/git4idea/src/git4idea/GitStandardRemoteBranch.java
+++ b/plugins/git4idea/src/git4idea/GitStandardRemoteBranch.java
@@ -19,14 +19,20 @@ import com.intellij.vcs.log.Hash;
import git4idea.branch.GitBranchUtil;
import git4idea.repo.GitRemote;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
public class GitStandardRemoteBranch extends GitRemoteBranch {
@NotNull private final GitRemote myRemote;
@NotNull private final String myNameAtRemote;
- public GitStandardRemoteBranch(@NotNull GitRemote remote, @NotNull String nameAtRemote, @NotNull Hash hash) {
- super(formStandardName(remote, GitBranchUtil.stripRefsPrefix(nameAtRemote)), hash);
+ @Deprecated
+ public GitStandardRemoteBranch(@NotNull GitRemote remote, @NotNull String nameAtRemote, @Nullable Hash hash) {
+ this(remote, nameAtRemote);
+ }
+
+ public GitStandardRemoteBranch(@NotNull GitRemote remote, @NotNull String nameAtRemote) {
+ super(formStandardName(remote, GitBranchUtil.stripRefsPrefix(nameAtRemote)));
myRemote = remote;
myNameAtRemote = GitBranchUtil.stripRefsPrefix(nameAtRemote);
}
diff --git a/plugins/git4idea/src/git4idea/GitSvnRemoteBranch.java b/plugins/git4idea/src/git4idea/GitSvnRemoteBranch.java
index 09ebc6a5a671..49524952a839 100644
--- a/plugins/git4idea/src/git4idea/GitSvnRemoteBranch.java
+++ b/plugins/git4idea/src/git4idea/GitSvnRemoteBranch.java
@@ -15,7 +15,6 @@
*/
package git4idea;
-import com.intellij.vcs.log.Hash;
import git4idea.repo.GitRemote;
import org.jetbrains.annotations.NotNull;
@@ -31,8 +30,8 @@ import org.jetbrains.annotations.NotNull;
*/
public class GitSvnRemoteBranch extends GitRemoteBranch {
- public GitSvnRemoteBranch(@NotNull String fullName, @NotNull Hash hash) {
- super(fullName, hash);
+ public GitSvnRemoteBranch(@NotNull String fullName) {
+ super(fullName);
}
@NotNull
diff --git a/plugins/git4idea/src/git4idea/GitUtil.java b/plugins/git4idea/src/git4idea/GitUtil.java
index 0058a2e9c96c..c770dddf57d2 100644
--- a/plugins/git4idea/src/git4idea/GitUtil.java
+++ b/plugins/git4idea/src/git4idea/GitUtil.java
@@ -726,7 +726,7 @@ public class GitUtil {
@NotNull GitRemote remote,
@NotNull String branchName) {
GitRemoteBranch remoteBranch = findRemoteBranch(repository, remote, branchName);
- return ObjectUtils.notNull(remoteBranch, new GitStandardRemoteBranch(remote, branchName, GitBranch.DUMMY_HASH));
+ return ObjectUtils.notNull(remoteBranch, new GitStandardRemoteBranch(remote, branchName));
}
@Nullable
diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java
index 299d3f7a3f86..6711f007ea6e 100644
--- a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java
+++ b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java
@@ -123,7 +123,7 @@ public class GitBranchUtil {
try {
String name = handler.run();
if (!name.equals("HEAD")) {
- return new GitLocalBranch(name, GitBranch.DUMMY_HASH);
+ return new GitLocalBranch(name);
}
else {
return null;
@@ -180,12 +180,12 @@ public class GitBranchUtil {
}
if (".".equals(remoteName)) {
- return new GitSvnRemoteBranch(branch, GitBranch.DUMMY_HASH);
+ return new GitSvnRemoteBranch(branch);
}
GitRemote remote = findRemoteByNameOrLogError(project, root, remoteName);
if (remote == null) return null;
- return new GitStandardRemoteBranch(remote, branch, GitBranch.DUMMY_HASH);
+ return new GitStandardRemoteBranch(remote, branch);
}
@Nullable
diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java b/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java
index 4f40fc68446d..d73151a1f221 100644
--- a/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java
+++ b/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java
@@ -17,6 +17,7 @@ package git4idea.branch;
import com.intellij.openapi.util.Condition;
import com.intellij.util.containers.ContainerUtil;
+import com.intellij.vcs.log.Hash;
import git4idea.GitBranch;
import git4idea.GitLocalBranch;
import git4idea.GitRemoteBranch;
@@ -25,50 +26,60 @@ import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Collections;
+import java.util.Map;
/**
*
- * Storage for local, remote and current branches.
- * The reason of creating this special collection is that
- * in the terms of performance, they are detected by {@link git4idea.repo.GitRepositoryReader} at once;
- * and also usually both sets of branches are needed by components, but are treated differently,
- * so it is more convenient to have them separated, but in a single container.
- *
- *
+ * Storage for local, remote and current branches.
+ * The reason of creating this special collection is that
+ * in the terms of performance, they are detected by {@link git4idea.repo.GitRepositoryReader} at once;
+ * and also usually both sets of branches are needed by components, but are treated differently,
+ * so it is more convenient to have them separated, but in a single container.
+ *
+ *
* @author Kirill Likhodedov
*/
public final class GitBranchesCollection {
-
- public static final GitBranchesCollection EMPTY = new GitBranchesCollection(Collections.emptyList(),
- Collections.emptyList());
- private final Collection myLocalBranches;
- private final Collection myRemoteBranches;
+ public static final GitBranchesCollection EMPTY =
+ new GitBranchesCollection(Collections.emptyMap(), Collections.emptyMap());
- public GitBranchesCollection(@NotNull Collection localBranches, @NotNull Collection remoteBranches) {
+ @NotNull
+ private final Map myLocalBranches;
+ @NotNull
+ private final Map myRemoteBranches;
+
+ public GitBranchesCollection(@NotNull Map localBranches, @NotNull Map remoteBranches) {
myRemoteBranches = remoteBranches;
myLocalBranches = localBranches;
}
@NotNull
public Collection getLocalBranches() {
- return Collections.unmodifiableCollection(myLocalBranches);
+ return Collections.unmodifiableCollection(myLocalBranches.keySet());
}
@NotNull
public Collection getRemoteBranches() {
- return Collections.unmodifiableCollection(myRemoteBranches);
+ return Collections.unmodifiableCollection(myRemoteBranches.keySet());
+ }
+
+ @Nullable
+ public Hash getHash(@NotNull GitBranch branch) {
+ if (branch instanceof GitLocalBranch) return myLocalBranches.get(branch);
+ if (branch instanceof GitRemoteBranch) return myRemoteBranches.get(branch);
+ return null;
}
@Nullable
public GitLocalBranch findLocalBranch(@NotNull String name) {
- return findByName(myLocalBranches, name);
+ return findByName(myLocalBranches.keySet(), name);
}
@Nullable
public GitBranch findBranchByName(@NotNull String name) {
- GitLocalBranch branch = findByName(myLocalBranches, name);
- return branch != null ? branch : findByName(myRemoteBranches, name);
+ GitLocalBranch branch = findByName(myLocalBranches.keySet(), name);
+ return branch != null ? branch : findByName(myRemoteBranches.keySet(), name);
}
@Nullable
diff --git a/plugins/git4idea/src/git4idea/log/GitLogProvider.java b/plugins/git4idea/src/git4idea/log/GitLogProvider.java
index a67c452e1503..6fb284755d3b 100644
--- a/plugins/git4idea/src/git4idea/log/GitLogProvider.java
+++ b/plugins/git4idea/src/git4idea/log/GitLogProvider.java
@@ -35,6 +35,7 @@ import com.intellij.vcs.log.impl.LogDataImpl;
import com.intellij.vcs.log.util.StopWatch;
import git4idea.*;
import git4idea.branch.GitBranchUtil;
+import git4idea.branch.GitBranchesCollection;
import git4idea.config.GitVersionSpecialty;
import git4idea.history.GitHistoryUtils;
import git4idea.repo.GitRepository;
@@ -351,15 +352,19 @@ public class GitLogProvider implements VcsLogProvider {
StopWatch sw = StopWatch.start("readBranches in " + repository.getRoot().getName());
VirtualFile root = repository.getRoot();
repository.update();
- Collection localBranches = repository.getBranches().getLocalBranches();
- Collection remoteBranches = repository.getBranches().getRemoteBranches();
+ GitBranchesCollection branches = repository.getBranches();
+ Collection localBranches = branches.getLocalBranches();
+ Collection remoteBranches = branches.getRemoteBranches();
Set refs = new THashSet(localBranches.size() + remoteBranches.size());
for (GitLocalBranch localBranch : localBranches) {
- refs.add(myVcsObjectsFactory.createRef(localBranch.getHash(), localBranch.getName(), GitRefManager.LOCAL_BRANCH, root));
+ Hash hash = branches.getHash(localBranch);
+ assert hash != null;
+ refs.add(myVcsObjectsFactory.createRef(hash, localBranch.getName(), GitRefManager.LOCAL_BRANCH, root));
}
for (GitRemoteBranch remoteBranch : remoteBranches) {
- refs.add(
- myVcsObjectsFactory.createRef(remoteBranch.getHash(), remoteBranch.getNameForLocalOperations(), GitRefManager.REMOTE_BRANCH, root));
+ Hash hash = branches.getHash(remoteBranch);
+ assert hash != null;
+ refs.add(myVcsObjectsFactory.createRef(hash, remoteBranch.getNameForLocalOperations(), GitRefManager.REMOTE_BRANCH, root));
}
String currentRevision = repository.getCurrentRevision();
if (currentRevision != null) { // null => fresh repository
diff --git a/plugins/git4idea/src/git4idea/push/GitPushSupport.java b/plugins/git4idea/src/git4idea/push/GitPushSupport.java
index 6c7b44f6055f..e755b7a92082 100644
--- a/plugins/git4idea/src/git4idea/push/GitPushSupport.java
+++ b/plugins/git4idea/src/git4idea/push/GitPushSupport.java
@@ -136,7 +136,7 @@ public class GitPushSupport extends PushSupport localBranches;
- @NotNull private final Collection remoteBranches;
+ @NotNull private final Map localBranches;
+ @NotNull private final Map remoteBranches;
GitBranchState(@Nullable String currentRevision,
@Nullable GitLocalBranch currentBranch,
@NotNull Repository.State state,
- @NotNull Collection localBranches,
- @NotNull Collection remoteBranches) {
+ @NotNull Map localBranches,
+ @NotNull Map remoteBranches) {
this.currentRevision = currentRevision;
this.currentBranch = currentBranch;
this.state = state;
@@ -58,12 +59,12 @@ class GitBranchState {
}
@NotNull
- public Collection getLocalBranches() {
+ public Map getLocalBranches() {
return localBranches;
}
@NotNull
- public Collection getRemoteBranches() {
+ public Map getRemoteBranches() {
return remoteBranches;
}
}
diff --git a/plugins/git4idea/src/git4idea/repo/GitRepoInfo.java b/plugins/git4idea/src/git4idea/repo/GitRepoInfo.java
index 33dc6a771f21..559ccbf678d5 100644
--- a/plugins/git4idea/src/git4idea/repo/GitRepoInfo.java
+++ b/plugins/git4idea/src/git4idea/repo/GitRepoInfo.java
@@ -16,6 +16,7 @@
package git4idea.repo;
import com.intellij.dvcs.repo.Repository;
+import com.intellij.vcs.log.Hash;
import git4idea.GitBranch;
import git4idea.GitLocalBranch;
import git4idea.GitRemoteBranch;
@@ -24,9 +25,7 @@ import gnu.trove.TObjectHashingStrategy;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Set;
+import java.util.*;
/**
* @author Kirill Likhodedov
@@ -37,19 +36,23 @@ public class GitRepoInfo {
@Nullable private final String myCurrentRevision;
@NotNull private final Repository.State myState;
@NotNull private final Set myRemotes;
- @NotNull private final Set myLocalBranches;
- @NotNull private final Set myRemoteBranches;
+ @NotNull private final Map myLocalBranches;
+ @NotNull private final Map myRemoteBranches;
@NotNull private final Set myBranchTrackInfos;
- public GitRepoInfo(@Nullable GitLocalBranch currentBranch, @Nullable String currentRevision, @NotNull Repository.State state,
- @NotNull Collection remotes, @NotNull Collection localBranches,
- @NotNull Collection remoteBranches, @NotNull Collection branchTrackInfos) {
+ public GitRepoInfo(@Nullable GitLocalBranch currentBranch,
+ @Nullable String currentRevision,
+ @NotNull Repository.State state,
+ @NotNull Collection remotes,
+ @NotNull Map localBranches,
+ @NotNull Map remoteBranches,
+ @NotNull Collection branchTrackInfos) {
myCurrentBranch = currentBranch;
myCurrentRevision = currentRevision;
myState = state;
myRemotes = new LinkedHashSet(remotes);
- myLocalBranches = new LinkedHashSet(localBranches);
- myRemoteBranches = new LinkedHashSet(remoteBranches);
+ myLocalBranches = new LinkedHashMap(localBranches);
+ myRemoteBranches = new LinkedHashMap(remoteBranches);
myBranchTrackInfos = new LinkedHashSet(branchTrackInfos);
}
@@ -64,15 +67,21 @@ public class GitRepoInfo {
}
@NotNull
- public Collection getLocalBranches() {
+ public Map getLocalBranchesWithHashes() {
return myLocalBranches;
}
@NotNull
- public Collection getRemoteBranches() {
+ public Map getRemoteBranchesWithHashes() {
return myRemoteBranches;
}
+ @NotNull
+ @Deprecated
+ public Collection getRemoteBranches() {
+ return myRemoteBranches.keySet();
+ }
+
@NotNull
public Collection getBranchTrackInfos() {
return myBranchTrackInfos;
@@ -120,34 +129,37 @@ public class GitRepoInfo {
@Override
public String toString() {
- return String.format("GitRepoInfo{current=%s, remotes=%s, localBranches=%s, remoteBranches=%s, trackInfos=%s}",
- myCurrentBranch, myRemotes, myLocalBranches, myRemoteBranches, myBranchTrackInfos);
+ return String
+ .format("GitRepoInfo{current=%s, remotes=%s, localBranches=%s, remoteBranches=%s, trackInfos=%s}", myCurrentBranch, myRemotes,
+ myLocalBranches, myRemoteBranches, myBranchTrackInfos);
}
- private static boolean areEqual(Collection c1, Collection c2) {
+ private static boolean areEqual(Map c1, Map c2) {
// GitBranch has perverted equals contract (see the comment there)
// until GitBranch is created only from a single place with correctly defined Hash, we can't change its equals
- THashSet set1 = new THashSet(c1, new BranchesComparingStrategy());
- THashSet set2 = new THashSet(c2, new BranchesComparingStrategy());
+ THashSet> set1 =
+ new THashSet>(c1.entrySet(), new BranchesComparingStrategy());
+ THashSet> set2 =
+ new THashSet>(c2.entrySet(), new BranchesComparingStrategy());
return set1.equals(set2);
}
- private static class BranchesComparingStrategy implements TObjectHashingStrategy {
+ private static class BranchesComparingStrategy implements TObjectHashingStrategy> {
@Override
- public int computeHashCode(@NotNull GitBranch branch) {
- return 31 * branch.getName().hashCode() + branch.getHash().hashCode();
+ public int computeHashCode(@NotNull Map.Entry extends GitBranch, Hash> branchEntry) {
+ return 31 * branchEntry.getKey().getName().hashCode() + branchEntry.getValue().hashCode();
}
@Override
- public boolean equals(@NotNull GitBranch b1, @NotNull GitBranch b2) {
+ public boolean equals(@NotNull Map.Entry extends GitBranch, Hash> b1, @NotNull Map.Entry extends GitBranch, Hash> b2) {
if (b1 == b2) {
return true;
}
if (b1.getClass() != b2.getClass()) {
return false;
}
- return b1.getName().equals(b2.getName()) && b1.getHash().equals(b2.getHash());
+ return b1.getKey().getName().equals(b2.getKey().getName()) && b2.getValue().equals(b2.getValue());
}
}
diff --git a/plugins/git4idea/src/git4idea/repo/GitRepositoryImpl.java b/plugins/git4idea/src/git4idea/repo/GitRepositoryImpl.java
index 02261494bafa..5774a47a4866 100644
--- a/plugins/git4idea/src/git4idea/repo/GitRepositoryImpl.java
+++ b/plugins/git4idea/src/git4idea/repo/GitRepositoryImpl.java
@@ -155,7 +155,7 @@ public class GitRepositoryImpl extends RepositoryImpl implements GitRepository {
@NotNull
public GitBranchesCollection getBranches() {
GitRepoInfo info = myInfo;
- return new GitBranchesCollection(info.getLocalBranches(), info.getRemoteBranches());
+ return new GitBranchesCollection(info.getLocalBranchesWithHashes(), info.getRemoteBranchesWithHashes());
}
@Override
@@ -198,7 +198,7 @@ public class GitRepositoryImpl extends RepositoryImpl implements GitRepository {
GitConfig config = GitConfig.read(myPlatformFacade, configFile);
Collection remotes = config.parseRemotes();
GitBranchState state = myReader.readState(remotes);
- Collection trackInfos = config.parseTrackInfos(state.getLocalBranches(), state.getRemoteBranches());
+ Collection trackInfos = config.parseTrackInfos(state.getLocalBranches().keySet(), state.getRemoteBranches().keySet());
return new GitRepoInfo(state.getCurrentBranch(), state.getCurrentRevision(), state.getState(), remotes,
state.getLocalBranches(), state.getRemoteBranches(), trackInfos);
}
diff --git a/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java b/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java
index f7f0684baa60..3fbcd6d9bf76 100644
--- a/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java
+++ b/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java
@@ -79,8 +79,8 @@ class GitRepositoryReader {
@NotNull
GitBranchState readState(@NotNull Collection remotes) {
- Pair, Set> branches = readBranches(remotes);
- Set localBranches = branches.first;
+ Pair