[git-index] use original path for renamed files for loading base content
authorJulia Beliaeva <Julia.Beliaeva@jetbrains.com>
Mon, 10 Aug 2020 21:18:21 +0000 (00:18 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Mon, 10 Aug 2020 22:12:32 +0000 (22:12 +0000)
GitOrigin-RevId: a1518b016b547780016b781f460cf0d5bd98e4a6

plugins/git4idea/src/git4idea/index/GitStageLineStatusTrackerProvider.kt

index d8286e7185f0f9dad4d7beec30e40c4cf47e2b28..fb1a4c9aac3f1d0423d90c479be7f1d034f25ac2 100644 (file)
@@ -77,7 +77,7 @@ class GitStageLineStatusTrackerProvider : LineStatusTrackerContentLoader {
     val indexDocument = runReadAction { FileDocumentManager.getInstance().getDocument(indexFile) } ?: return null
 
     val bytes = GitFileUtils.getFileContent(project, repository.root, GitUtil.HEAD,
-                                            VcsFileUtil.relativePath(repository.root, filePath))
+                                            VcsFileUtil.relativePath(repository.root, status.path(ContentVersion.HEAD)))
     val charset: Charset = DiffContentFactoryImpl.guessCharset(project, bytes, filePath)
     val headContent = CharsetToolkit.decodeString(bytes, charset)
     val correctedText = StringUtil.convertLineSeparators(headContent)