Change GitProjectData.getRepositoryMapping to work on linked resources
commitd6103ff0f5949bbc2e3d211ed0eab8ffbdeb257f
authorShawn O. Pearce <spearce@spearce.org>
Tue, 5 Aug 2008 23:31:42 +0000 (5 16:31 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 10 Aug 2008 06:44:48 +0000 (9 23:44 -0700)
treec627bd23959649e4a68113ac966b8566eed9a0e2
parent91f0daac8a1eae6d2c8c300ed98827c70a980e0a
Change GitProjectData.getRepositoryMapping to work on linked resources

When we are looking up the mapping for a file contained within a linked
directory the linked directory may be mapped to a Git repository that is
not the same as the project itself, or the project doesn't even have a
Git repository.

This may also be necessary for submodules.  For example a single project
in Eclipse may actually contain several Git submodules below it and each
must have its own RepositoryMapping.

We now store the RepositoryMapping for a given IContainer directly on
that container using a session property.  This way Eclipse manages the
hash lookups for us, and we can efficiently walk up the tree to locate
the nearest mapping for any resource.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java