diff options
author | Yuxuan 'fishy' Wang <fishywang@google.com> | 2014-08-18 11:12:08 -0700 |
---|---|---|
committer | Yuxuan 'fishy' Wang <fishywang@google.com> | 2014-08-18 11:12:08 -0700 |
commit | 66fc8345304087a9d5e97afc08cf340767f6f1d2 (patch) | |
tree | a542549dd58c62b3caa9b598278ab895ec77369c /org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java | |
parent | 5a26c538b392c1dbcb81783e9173db603a88f44f (diff) | |
download | jgit-66fc8345304087a9d5e97afc08cf340767f6f1d2.tar.gz jgit-66fc8345304087a9d5e97afc08cf340767f6f1d2.zip |
Support remote aliases in repo manifest.
Change-Id: Icbe5761b9d8a4ae5305bfe45b2d042f214156fc8
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java index 5f2aece47e..d24d375cbc 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java @@ -641,6 +641,30 @@ public class RepoCommandTest extends RepositoryTestCase { assertTrue("We should have bar", file.exists()); } + @Test + public void testRemoteAlias() throws Exception { + StringBuilder xmlContent = new StringBuilder(); + xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") + .append("<manifest>") + .append("<remote name=\"remote1\" fetch=\".\" alias=\"remote2\" />") + .append("<default revision=\"master\" remote=\"remote2\" />") + .append("<project path=\"foo\" name=\"") + .append(defaultUri) + .append("\" />") + .append("</manifest>"); + + Repository localDb = createWorkRepository(); + JGitTestUtil.writeTrashFile( + localDb, "manifest.xml", xmlContent.toString()); + RepoCommand command = new RepoCommand(localDb); + command + .setPath(localDb.getWorkTree().getAbsolutePath() + "/manifest.xml") + .setURI(rootUri) + .call(); + File file = new File(localDb.getWorkTree(), "foo/hello.txt"); + assertTrue("We should have foo", file.exists()); + } + private void resolveRelativeUris() { // Find the longest common prefix ends with "/" as rootUri. defaultUri = defaultDb.getDirectory().toURI().toString(); |