diff --git a/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java b/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java index 2eb5b138dd8b..e3ea1dc6003c 100644 --- a/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java +++ b/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java @@ -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)); diff --git a/plugins/git4idea/src/git4idea/annotate/GitFileAnnotation.java b/plugins/git4idea/src/git4idea/annotate/GitFileAnnotation.java index 8ca02c145245..93bb1f47168f 100644 --- a/plugins/git4idea/src/git4idea/annotate/GitFileAnnotation.java +++ b/plugins/git4idea/src/git4idea/annotate/GitFileAnnotation.java @@ -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 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; }