summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2014-11-24 00:52:45 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2014-12-16 15:29:08 +0100
commit8812e6f3f60dc6bc86ba57c3e82288780f735f6b (patch)
tree6b37c022005062e9c6243882e7096687feebe500 /org.eclipse.jgit.pgm.test
parent490660a7c61d6226ac52d0e00198dd90a3891115 (diff)
downloadjgit-8812e6f3f60dc6bc86ba57c3e82288780f735f6b.tar.gz
jgit-8812e6f3f60dc6bc86ba57c3e82288780f735f6b.zip
[pgm] Add option --tags for ls-remote
Bug: 444072 Change-Id: I52b470924609fc201e078d9d232aad257506728d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm.test')
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/LsRemoteTest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/LsRemoteTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/LsRemoteTest.java
index f03edb0693..ba6b771de5 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/LsRemoteTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/LsRemoteTest.java
@@ -104,4 +104,35 @@ public class LsRemoteTest extends CLIRepositoryTestCase {
"d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/heads/test",
"" }, result.toArray());
}
+
+ @Test
+ public void testLsRemoteTags() throws Exception {
+ final List<String> result = CLIGitCommand.execute(
+ "git ls-remote --tags " + db.getDirectory(), db);
+ assertArrayEquals(new String[] {
+ "efc02078d83a5226986ae917323acec7e1e8b7cb refs/tags/tag1",
+ "d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/tags/tag1^{}",
+ "4e4b837e0fd4ba83c003678b03592dc1509a4115 refs/tags/tag2",
+ "d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/tags/tag2^{}",
+ "489384bf8ace47522fe32093d2ceb85b65a6cbb1 refs/tags/tag3",
+ "d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/tags/tag3^{}",
+ "" }, result.toArray());
+ }
+
+ @Test
+ public void testLsRemoteHeadsTags() throws Exception {
+ final List<String> result = CLIGitCommand.execute(
+ "git ls-remote --heads --tags " + db.getDirectory(), db);
+ assertArrayEquals(new String[] {
+ "d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/heads/master",
+ "d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/heads/test",
+ "efc02078d83a5226986ae917323acec7e1e8b7cb refs/tags/tag1",
+ "d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/tags/tag1^{}",
+ "4e4b837e0fd4ba83c003678b03592dc1509a4115 refs/tags/tag2",
+ "d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/tags/tag2^{}",
+ "489384bf8ace47522fe32093d2ceb85b65a6cbb1 refs/tags/tag3",
+ "d0b1ef2b3dea02bb2ca824445c04e6def012c32c refs/tags/tag3^{}",
+ "" }, result.toArray());
+ }
+
}