aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
authorRobin Stocker <robin@nibor.org>2013-07-21 16:23:12 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2013-08-13 00:04:37 +0200
commit9b26e4bffb06ddf12c9c3040e3f25482655d1d89 (patch)
treef8e5b59f4e5035e72ea80c6614d43151dc879feb /org.eclipse.jgit.test/tst/org/eclipse/jgit
parent6fb8d2345b3eb0c578a5c59e74e67c202987fe6d (diff)
downloadjgit-9b26e4bffb06ddf12c9c3040e3f25482655d1d89.tar.gz
jgit-9b26e4bffb06ddf12c9c3040e3f25482655d1d89.zip
Enable LsRemoteCommand to work without local repository
It's supported by C Git and can be useful. Bug: 413388 Change-Id: I12c6c10e791cc09ee271d89eb8b8d32f53e385db Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java
index 991214d581..f31276dee4 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, Chris Aniszczyk <caniszczyk@gmail.com>
+ * Copyright (C) 2011, 2013 Chris Aniszczyk <caniszczyk@gmail.com> and others.
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -128,4 +128,12 @@ public class LsRemoteCommandTest extends RepositoryTestCase {
assertEquals(2, refs.size());
}
+ @Test
+ public void testLsRemoteWithoutLocalRepository() throws Exception {
+ String uri = "file://" + git.getRepository().getWorkTree().getPath();
+ Collection<Ref> refs = Git.lsRemoteRepository().setRemote(uri).setHeads(true).call();
+ assertNotNull(refs);
+ assertEquals(2, refs.size());
+ }
+
}