DESCRIPTION

Support copy/move of workspace if Git repository is under workspace

If git repositories are located under the workspace path moving or
copying the workspace broke the repository path information in
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs
since all repository paths were stored as absolute paths and paths
of repositories located under the moved or copied workspace weren't
matching this persisted paths anymore.

Fix this by storing the repository path relative to the workspace root
if a repository path is located under the workspace root. For
repositories not located under the workspace root still store the
absolute path since otherwise their path would break if the workspace is
moved or copied.

Bug: 358285
Change-Id: Ib73b76eb1d63587a767fec59c076fbe51c75e2f1
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2016-03-03 23:42:13.000000000

Uploaded patch set 3: Commit message was updated.

-------------------------------------
author: Brenden Conley
date: 2016-03-04 00:54:33.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2016-03-04 01:22:52.000000000

Patch Set 3: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/8249/ : UNSTABLE

-------------------------------------
author: Alayna Houston
date: 2016-03-04 07:48:41.000000000

Patch Set 3:

Do we have to care about backwards compatibility here? Once the pref is stored with relative paths and the user tries to open the workspace with an Eclipse that has an EGit that doesn't resolve upon loading, we'll end up with strange effects as File.getAbsolutePath() will resolve against the process's current working directory. Is that always the workspace root?

-------------------------------------
author: Douglas Trujillo
date: 2016-03-04 22:36:11.000000000

Patch Set 3:

> Do we have to care about backwards compatibility here? Once the
 > pref is stored with relative paths and the user tries to open the
 > workspace with an Eclipse that has an EGit that doesn't resolve
 > upon loading, we'll end up with strange effects as
 > File.getAbsolutePath() will resolve against the process's current
 > working directory. Is that always the workspace root?

you are right, and the current directory (tried this on Mac) is the directory containing the eclipse executable which is different from the current workspace's directory

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-03-15 14:59:20.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

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