DESCRIPTION

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

The RepositoryFinder.register(IContainer, File) method is capable of
registering 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 on Posix platforms 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 Posix platforms.

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

COMMENTS

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

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2012-02-27 23:09:13.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/2537/ 

-------------------------------------
author: Douglas Trujillo
date: 2012-02-27 23:10:34.000000000

Patch Set 2: Verified; Looks good to me, approved; IP review completed

- rebased
- fixed minor issues in commit message

thanks Brad for contributing this patch

-------------------------------------
author: Douglas Trujillo
date: 2012-02-27 23:10:36.000000000

Change has been successfully merged into the git repository.

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