Make diff from staging view also work for files not in the workspace
* Make SelectionUtils.getRepository() keep going as long as all
RepositorMappings are null, so that it does consider adapters.
Previously, it returned null upon the first null mapping.
(RepositoryMapping assumes paths to correspond to an accessible
workspace IResource -- i.e., works only for files in open Eclipse
projects.)
* Since RepositoryMapping.getMapping() only returns something for
resources in open projects, give the LocalNonWorkspaceTypedElement
the known repository directly. Also, StagingEntry must adapt to
accessible resources only.
* Fix dirty state handling in GitCompareFileRevisionEditorInput.
This makes diffs from the staging view work even for files
that are in closed projects, or in no project at all (i.e., Eclipse
project removed from workspace, or a file in the git repo outside of
any project, such as a global .gitignore).
Bug: 481682
Change-Id: I84ca034f6f5c01eeeb889b1e898cb0dba6039b80
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>