Fix importing of submodule repositories using Git 1.7.8 layout
commit83511314eb5f79ab3b5b2ab1923b6fead07c12d3
authorRobin Stocker <robin@nibor.org>
Mon, 9 Dec 2013 23:19:59 +0000 (10 00:19 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 15 Dec 2013 22:27:01 +0000 (15 23:27 +0100)
tree514c9703bae96de79941235fa8eb35ce06ff74e1
parent667a055b385ab309bfbaac2afec9779a808ba359
Fix importing of submodule repositories using Git 1.7.8 layout

The submodule Git directory is in .git/modules/$mod and the .git in the
submodule directory is a text file with "gitdir: ../.git/modules/$mod".

This change includes three parts:

* Use FileRepositoryBuilder in RepositoryFinder to find repos, because
  it already knows how to handle the above format
* Fix GitProjectData to handle RepositoryMapping where getGitDirPath
  returns an absolute path (IPath#append just ignores that)
* Fix ExistingOrNewPage to be able to handle absolute paths where the
  Git directory is not below the worktree path

FileRepositoryBuilder from JGit does not try to find a repository inside
GIT_CEILING_DIRECTORIES (like C Git does, see [1]), whereas EGit did
include the ceiling directories themselves. This change in behavior
required adjusting the test setup to set the ceiling to the parent dir.

[1] http://git-scm.com/docs/git#_the_git_repository

Bug: 378611
Change-Id: Iecf1c85f4d24b153ac734b3bd615e72fdfcb3717
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java
org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java
org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/ExistingOrNewPage.java