diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java index 2504c345b559..adc2f97ade50 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java @@ -510,6 +510,10 @@ public class GitBranchUtil { rootCandidate = root; } } + LOG.debug("The best candidate: " + rootCandidate); + if (rootCandidate == null) { + rootCandidate = gitRoots[0]; + } LOG.debug("Returning the best candidate: " + rootCandidate); return rootCandidate; }