Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Halstrick2015-03-04 11:43:01 +0000
committerMatthias Sohn2015-03-09 20:48:04 +0000
commit0e3ddea1b028836889fc13ad56b1dec5d5438fc9 (patch)
tree112e998c4248fbdf7375c8ea8f07e592313be1c3 /org.eclipse.jgit.pgm.test/tst
parenta8fb77853a97568dc03ca9513eadb01bb2b50c06 (diff)
downloadjgit-0e3ddea1b028836889fc13ad56b1dec5d5438fc9.tar.gz
jgit-0e3ddea1b028836889fc13ad56b1dec5d5438fc9.tar.xz
jgit-0e3ddea1b028836889fc13ad56b1dec5d5438fc9.zip
Add "--long" option to JGit describe
Native git supports "git describe --long". This will enforce returning a long description of a commit even if a tag is directly pointing to the commit (in contrast to just returning the tag name as it is now). This commit teaches JGits DescribeCommand and the describe command in the pgm package to support "--long". Bug: 460991 Change-Id: I65e179b79e89049c6deced3c71cb3ebb08ed0a8f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm.test/tst')
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DescribeTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DescribeTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DescribeTest.java
index 4ab849b0fb..6352a26524 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DescribeTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DescribeTest.java
@@ -96,4 +96,11 @@ public class DescribeTest extends CLIRepositoryTestCase {
assertArrayEquals(new String[] { "v1.0-1-g56f6ceb", "" },
execute("git describe"));
}
+
+ @Test
+ public void testDescribeTagLong() throws Exception {
+ initialCommitAndTag();
+ assertArrayEquals(new String[] { "v1.0-0-g6fd41be", "" },
+ execute("git describe --long HEAD"));
+ }
}

Back to the top