DESCRIPTION

Fix recognition of submodules in folders.

Most of the basic plumbing for this was already in place, but it looks
as if the implementation was never really finished. For instance,
GitProjectData is prepared to record RepositoryMapping on container
level, not just for projects. The feature was just not used, and many
places in EGit make assumptions that imply that a project is fully
within one repository. This is a first commit to get rid of this
assumption, and to properly deal with submodules that exist only as
folders in the Eclipse workspace.

Augment the already existing resource change listener in GitProjectData
to also handle additions of DOT_GIT resources. In that way it'll pick
up submodules as they appear in the Eclipse resource tree.

RepositoryMapping.getMapping(IResource) must consider mappings
entered for folders below the project level. One mustn't jump directly
to project level; that will skip any submodules that might have been
applicable.

StagingView: no need anymore to use a submodule walk. The
RepositoryMapping for any resource will point to the correct
repository, even if it's a submodule. Not using a submodule walk also
avoids problem with the walk returning non-normalized git directory
paths that may contain ".." segments, while our RepositoryCache uses
normalized paths. This may yield two versions of the same repo in the
cache, and listening for index diff changes on one wouldn't trigger on
the other.

GitResourceDeltaVisitor: must descend into folders even if the
repository doesn't match on project level. Otherwise submodules are not
updated.

For scheduling rule calculation, it is not sufficient to search for
projects in the repository's working directory. One also needs to
include projects containing the repository working directory.

Deprecated:
* RepositoryMapping.getSubmoduleRepository(IResource)

Also changed some uses of RepositoryMapping.getMapping(IProject) to
RepositoryMapping.getMapping(IResource). I'd like to have deprecated
the project variant, but this needs more careful analysis of the
remaining places its used.

Properly adding submodule mappings and considering them fixes at least
bug 446344, comment 11. Also related is bug 401556, though that was
reported for the behavior in the Repositories view, which isn't fixed by
this commit yet. However, a selection in the project explorer for a
folder belonging to a submodule showed the same erroneous behavior.

Added new tests.

Bug: 446344
Bug: 401556
Change-Id: I4caa06113b5280114a7816f2c3932711b2fedf08
Signed-off-by: Alayna Houston xxx@xxx.xxx
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2016-02-25 20:24:16.000000000

Uploaded patch set 8.

-------------------------------------
author: Brenden Conley
date: 2016-02-25 20:24:22.000000000

Patch Set 8:

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

-------------------------------------
author: Brenden Conley
date: 2016-02-25 20:50:14.000000000

Patch Set 8: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2016-02-25 23:41:34.000000000

Patch Set 8: Code-Review+2

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-02-25 23:41:39.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

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