DESCRIPTION

Add a helper method to find repository from given resource path

In most cases we can use RepositoryMapping to find the repository
responsible for versioning a given resource. But the team framework
doesn't allow to use RepositoryMappings to find the repository for
resources in a closed project. Hence add a helper method to find the
repository based on comparison of resource path and the working tree
path of all repositories known to the RepositoryCache.

Change-Id: I8d26d5a6ed4aa6661eb88d540ab643fb3b6cebbc
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Brenden Conley
date: 2013-11-27 21:48:19.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2013-11-27 22:02:40.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/5379/ : SUCCESS

-------------------------------------
author: Danika Greer
date: 2013-11-27 22:10:34.000000000

Patch Set 1: Code-Review-1

(2 comments)

See inline comments, otherwise looks good.

Line:93, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java -> IResource#getLocation can return null, this must be checked.

Line:95, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java -> Could you rename repositoryPath to closestRepoPath? I think this would be easier to read then. You could also use segmentCount to compare which path is longer, right?

-------------------------------------
author: Douglas Trujillo
date: 2013-11-27 22:39:07.000000000

Patch Set 1:

(2 comments)

also rebased

Line:93, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java -> Done

Line:95, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java -> Done

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