DESCRIPTION

Fix for RepositoryMapping returning wrong mapping.

The logic in getMapping did not cover the case properly when a path was
totally outside a repository mapping. For example, when workingTree is
"C:\my\working\tree" and the path in question is "D:\a\cloned\repo"
path.makeRelativTo(workingTree) would return path "D:\a\cloned\repo". 
As a result, the if clause is true and the mapping is returned although
the working tree from the mapping is completely unrelated to the path.

A better (and simpler) way is to simply use workingTree.isPrefixOf(path)
for the check. This properly determines if a path is within a working
tree.

The commit also adds a test for detecting the situation.

Bug: 403008
Change-Id: I5ecd9e75beb4da7eb9c36efbe91034067f343344
Signed-off-by: Rocco Fowler xxx@xxx.xxx


COMMENTS

author: Rocco Fowler
date: 2013-03-12 15:44:14.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2013-03-12 15:44:20.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2013-03-12 15:59:04.000000000

Patch Set 3: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/egit.gerrit/4270/ : SUCCESS

-------------------------------------
author: Danika Greer
date: 2013-03-12 16:15:13.000000000

Patch Set 3: (3 inline comments)



Line:2, org.eclipse.egit.core.test/src/org/eclipse/egit/core/project/RepositoryMappingTest.java -> Sorry to bother with this, but the year should be "2012, 2013".

Line:7, /COMMIT_MSG -> Please change to "Fix RepositoryMapping bug on Windows for paths with different devices".

Line:12, /COMMIT_MSG -> It's relative, with an eee :). Also, trailing whitespace here.

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