DESCRIPTION

Fix RepositoryMapping bug on Windows for paths with different devices.

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.makeRelative(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 16:52:15.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2013-03-12 16:52:21.000000000

Patch Set 4:

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

-------------------------------------
author: Brenden Conley
date: 2013-03-12 17:06:27.000000000

Patch Set 4: Verified

Build Successful 

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

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