* @return a map containing a list of repository relative paths for each
* occurring repository
*/
public static Map<Repository, Collection<String>> splitPathsByRepository(
Collection<IPath> paths) {
RepositoryCache repositoryCache = Activator.getDefault()
.getRepositoryCache();
Map<Repository, Collection<String>> result = new HashMap<Repository, Collection<String>>();
for (IPath path : paths) {
Repository repository = repositoryCache.getRepository(path);
if (repository != null) {
IPath repoPath = new Path(repository.getWorkTree()
.getAbsolutePath());
IPath repoRelativePath = path.makeRelativeTo(repoPath);
addPathToMap(repository, repoRelativePath.toString(), result);