DESCRIPTION

Fix the behavior of the Share|Git... dialog when a repo is a symlink link

The RepositoryFinder.register(IContainer, File) method is capable of
regsitering a repository with a path that is not relative to the containing
project, because of the nature of File.getCanonicalFile().  For instance,
if you are working in /dev/workspace/project and that path contains a .git
symlink which points to /dev/repo/project.git, then the registered path for
that repository will be the latter.  However, code in RepositoringMapping.
getGitDirAbsolutePath() and ExistingOrNewPage.fillTreeItemWithGitDirectory()
make assumptions about it being relative to the containing project.

This only occurs in Linux because File.getCanonicalFile() does not have the
same behavior on Windows.  Specifically it doesn't recognize junctions (the
Windows equivalent to symbolic links) and therefore does not try to resolve
them.

This patch addresses the problem by removing the use of
File.getCanonicalFile() and replacing it with File.getAbsoluteFile() which
is already there as a fallback if File.getCanonicalFile() throws an
exception.  This will make the behavior of sharing a project the same on
both Windows and Linux.

Bug: 338989
Change-Id: I6901f386b00e8cd5208f22aa93298bca4d750dd3
Signed-off-by: Bradley Austin Davis xxx@xxx.xxx


COMMENTS

author: Douglas Trujillo
date: 2012-02-27 23:09:30.000000000

Patch Set 1: (3 inline comments)



Line:7, /COMMIT_MSG -> style nit: header line is too wide

Line:10, /COMMIT_MSG -> typo: s/regsitering/registering/

Line:18, /COMMIT_MSG -> this occurs on all Posix platforms, only Windows behaves differently

-------------------------------------
