git: annotations - remove duplicated getCurrentRevision request

This commit is contained in:
Aleksey Pivovarov
2016-08-31 13:17:25 +03:00
parent 9a0b394f0b
commit 674b735b95
2 changed files with 6 additions and 6 deletions
@@ -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;
}