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
Signed-off-by: Danika Greer xxx@xxx.xxx


COMMENTS

author: Danika Greer
date: 2013-03-12 17:15:53.000000000

Uploaded patch set 5.

-------------------------------------
author: Danika Greer
date: 2013-03-12 17:16:27.000000000

Patch Set 5:

Fixed copyright date, signed off.

-------------------------------------
author: Danika Greer
date: 2013-03-12 17:16:40.000000000

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



-------------------------------------
author: Danika Greer
date: 2013-03-12 17:16:41.000000000

Change has been successfully merged into the git repository.

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