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.makeRelativ(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: Brenden Conley
date: 2013-03-12 10:13:35.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2013-03-12 10:18:04.000000000

Patch Set 1: Fails

Build Failed 

https://hudson.eclipse.org/sandbox/job/egit.gerrit/4268/ : FAILURE

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