diff options
author | Thomas Wolf | 2015-10-18 19:55:10 +0000 |
---|---|---|
committer | Andrey Loskutov | 2015-10-22 20:14:09 +0000 |
commit | 2f9171f9268056c6a99aa24dc693fc8dd5bc5b56 (patch) | |
tree | e151bc247417cfc93afa719d9eac8ea6fa4ef478 /org.eclipse.egit.ui.test | |
parent | 57955829fd69885b2e58af41de0d5dd56b7ef4d1 (diff) | |
download | egit-2f9171f9268056c6a99aa24dc693fc8dd5bc5b56.tar.gz egit-2f9171f9268056c6a99aa24dc693fc8dd5bc5b56.tar.xz egit-2f9171f9268056c6a99aa24dc693fc8dd5bc5b56.zip |
Alleviate problems on case-insensitive file systems
We have _no_ foolproof way to correctly compare paths:
* IPath treats paths always case-sensitively, both in equals()
and in isPrefixOf(), which can give rise to unexpected problems
on case-insensitive file systems such as NTFS on Windows or HFS+
on OS X.
* java.io.File considers HFS+ (Mac) a case-sensitive UnixFileSystem,
which is incorrect. (HFS+ can be either, and by default on Macs
is case-insensitive.) On Windows, File is indeed case-insensitive.
* java.nio.file.Path also uses a case-sensitive sun.nio.fs.UnixPath
on HFS+. On Windows, it is case-insensitive.
* org.eclipse.jgit.util.FS_POSIX.isCaseSensitive() returns
unconditionally false for Macs. However, HFS+ partitions _can_ be
case-sensitive. Furthermore, org.eclipse.jgit.util.FS doesn't have
operations for case-normalization.
* org.eclipse.core.internal.resources.Project sets the project location
to the canonicalized file path. File.getCanonicalFile() does appear
to normalize capitalization to the form actually used in the file
system.
* Many places in EGit do path comparisons between Eclipse IResources
and git working trees using any of the possibilities above.
Options to fix this are:
* Use java.io.File or java.nio.file.Path, but that would leave HFS+ out
in the cold. Would require lots of changes throughout EGit to root
out any uses of comparisons via IPath.
* Write our own comparison and prefix methods. Make sure only those are
used. Any collections storing paths or files would need to be checked
and adapted; or maybe we'd even need or own subclass of File...
* Ensure that we use for repositories only the canonical path, like
Eclipse core does for IProjects, so that the same casing is used.
This change implements the latter. It ensures that EGit and the
Eclipse resource tree both have the same idea of where things are and
should thus resolve most case-sensitivity problems, even if IPath is
used. (That's bug 477281.)
Fixes bug 478877. Depends on https://git.eclipse.org/r/#/c/58760/ in
JGit.
Bug: 477281
Bug: 478877
Change-Id: I1d29203e678afb3fb43a6fcb334706c9473afc4e
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui.test')
0 files changed, 0 insertions, 0 deletions