diff --git a/plugins/git4idea/src/git4idea/history/wholeTree/DetailsCache.java b/plugins/git4idea/src/git4idea/history/wholeTree/DetailsCache.java index af47ebbbfcdb..b78613ea66ef 100644 --- a/plugins/git4idea/src/git4idea/history/wholeTree/DetailsCache.java +++ b/plugins/git4idea/src/git4idea/history/wholeTree/DetailsCache.java @@ -101,11 +101,10 @@ public class DetailsCache { } } - @NotNull + @Nullable public List getBranches(final VirtualFile root, final AbstractHash hash) { synchronized (myLock) { - List branches = myBranches.get(new Pair(root, hash)); - return branches == null ? Collections.emptyList() : branches; + return myBranches.get(new Pair(root, hash)); } } @@ -157,8 +156,7 @@ public class DetailsCache { @Override public void run(@NotNull ProgressIndicator indicator) { if (!recheck.process(abstractHash)) return; - List branches1 = getBranches(root, abstractHash); - if (branches1 != null && ! branches1.isEmpty()) return; + if (getBranches(root, abstractHash) != null) return; List branches; try { branches = new LowLevelAccessImpl(myProject, root).getBranchesWithCommit(abstractHash.getString()); diff --git a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java index bd2e523d44fd..5f2dc82d4777 100644 --- a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java +++ b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java @@ -495,7 +495,7 @@ public class GitLogUI implements Disposable { if (commitI == null) return; final VirtualFile root = commitI.selectRepository(myRootsUnderVcs); final List branches = myDetailsCache.getBranches(root, commitI.getHash()); - if (branches != null && ! branches.isEmpty()) { + if (branches != null) { try { myBranchesLoader.take(commitI, branches); } @@ -1050,7 +1050,8 @@ public class GitLogUI implements Disposable { @NotNull @Override public List getContainingBranches(@NotNull VirtualFile root, @NotNull AbstractHash commitHash) { - return myDetailsCache.getBranches(root, commitHash); + List branches = myDetailsCache.getBranches(root, commitHash); + return branches == null ? Collections.emptyList() : branches; } }; }