mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] Better fix for IDEA-97728: let getBranches return null
getBranches returns null when the information is not available => the meaning is different from the empty list. This reverts incorrect38caf3afand another way to fix it24e296ac2.
This commit is contained in:
@@ -101,11 +101,10 @@ public class DetailsCache {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
public List<String> getBranches(final VirtualFile root, final AbstractHash hash) {
|
||||
synchronized (myLock) {
|
||||
List<String> branches = myBranches.get(new Pair<VirtualFile, AbstractHash>(root, hash));
|
||||
return branches == null ? Collections.<String>emptyList() : branches;
|
||||
return myBranches.get(new Pair<VirtualFile, AbstractHash>(root, hash));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,8 +156,7 @@ public class DetailsCache {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
if (!recheck.process(abstractHash)) return;
|
||||
List<String> branches1 = getBranches(root, abstractHash);
|
||||
if (branches1 != null && ! branches1.isEmpty()) return;
|
||||
if (getBranches(root, abstractHash) != null) return;
|
||||
List<String> branches;
|
||||
try {
|
||||
branches = new LowLevelAccessImpl(myProject, root).getBranchesWithCommit(abstractHash.getString());
|
||||
|
||||
@@ -495,7 +495,7 @@ public class GitLogUI implements Disposable {
|
||||
if (commitI == null) return;
|
||||
final VirtualFile root = commitI.selectRepository(myRootsUnderVcs);
|
||||
final List<String> 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<String> getContainingBranches(@NotNull VirtualFile root, @NotNull AbstractHash commitHash) {
|
||||
return myDetailsCache.getBranches(root, commitHash);
|
||||
List<String> branches = myDetailsCache.getBranches(root, commitHash);
|
||||
return branches == null ? Collections.<String>emptyList() : branches;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user