Hi all,
I implemented a feature to show diff from two remote branches using a custom virtual file implementation. I found a strange behaviour in the DiffView and I don’t know if it’s a problem of my implementation or a feature.
Now the problem is this one:
- Show the diff of file A
- Change the file A (commit & push)
- Open diff for file A again
- The content is the same
I debug the code and the file is read from remote correctly, so I think is cached somewhere
But if I change it to a LightVirtualFile
the changes are shown. Do I have to do something special for equals
and hash
? At the moment I define 2 files the same if have the same path, but maybe I should consider timestamps and/or content.
Mainly I create a Diff View using this command:
DiffManager.getInstance().showDiff(project, diffRequest, DiffDialogHints.DEFAULT)
and the diff request is created in this way:
DiffRequestFactory.getInstance().createFromFiles(project, targetFile, sourceFile).also {
//adding some context information in User data
}