mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
git: annotations - remove duplicated getCurrentRevision request
This commit is contained in:
@@ -129,12 +129,13 @@ public class GitAnnotationProvider implements AnnotationProviderEx {
|
||||
assert vcs != null;
|
||||
|
||||
VcsRevisionNumber actualRevision = revision != null ? revision : vcs.getDiffProvider().getCurrentRevision(file);
|
||||
|
||||
if (actualRevision != null) {
|
||||
Object annotatedData = myCache.get(repositoryFilePath, GitVcs.getKey(), actualRevision);
|
||||
if (annotatedData instanceof CachedData) return restoreFromCache(file, revision, (CachedData)annotatedData);
|
||||
if (annotatedData instanceof CachedData) return restoreFromCache(file, actualRevision, (CachedData)annotatedData);
|
||||
}
|
||||
|
||||
GitFileAnnotation fileAnnotation = doAnnotate(repositoryFilePath, revision, file);
|
||||
GitFileAnnotation fileAnnotation = doAnnotate(repositoryFilePath, actualRevision, file);
|
||||
|
||||
if (actualRevision != null) {
|
||||
myCache.put(repositoryFilePath, GitVcs.getKey(), actualRevision, cacheData(fileAnnotation));
|
||||
|
||||
@@ -73,16 +73,15 @@ public class GitFileAnnotation extends FileAnnotation {
|
||||
}
|
||||
};
|
||||
|
||||
public GitFileAnnotation(@NotNull final Project project,
|
||||
public GitFileAnnotation(@NotNull Project project,
|
||||
@NotNull VirtualFile file,
|
||||
@Nullable final VcsRevisionNumber revision,
|
||||
@Nullable VcsRevisionNumber revision,
|
||||
@NotNull List<LineInfo> lines) {
|
||||
super(project);
|
||||
myProject = project;
|
||||
myFile = file;
|
||||
myVcs = ObjectUtils.assertNotNull(GitVcs.getInstance(myProject));
|
||||
myBaseRevision = revision == null ? (myVcs.getDiffProvider().getCurrentRevision(file)) : revision;
|
||||
|
||||
myBaseRevision = revision;
|
||||
myLines = lines;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user