summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test/tst
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2022-02-20 12:04:11 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2022-03-02 09:56:04 +0100
commit9c27002c492e29a7f81a97899e779d5778fda796 (patch)
tree32242b2015e406a5b05607df9118285064ffd0b0 /org.eclipse.jgit.pgm.test/tst
parent85d8b31cb25e779f2511d96e0dd1a0606512e8b4 (diff)
downloadjgit-9c27002c492e29a7f81a97899e779d5778fda796.tar.gz
jgit-9c27002c492e29a7f81a97899e779d5778fda796.zip
[pgm] Add describe --abbrev option
Change-Id: I8adf2fad21db71b43266d3f274143eee6bc9dce2
Diffstat (limited to 'org.eclipse.jgit.pgm.test/tst')
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DescribeTest.java25
1 files changed, 25 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 4bad73b5b5..c78544309b 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
@@ -89,6 +89,31 @@ public class DescribeTest extends CLIRepositoryTestCase {
}
@Test
+ public void testDescribeCommitMatchAbbrev() throws Exception {
+ initialCommitAndTag();
+ secondCommit();
+ assertArrayEquals(new String[] { "v1.0-1-g56f6cebdf3f5", "" },
+ execute("git describe --abbrev 12 --match v1.*"));
+ }
+
+ @Test
+ public void testDescribeCommitMatchAbbrevMin() throws Exception {
+ initialCommitAndTag();
+ secondCommit();
+ assertArrayEquals(new String[] { "v1.0-1-g56f6", "" },
+ execute("git describe --abbrev -5 --match v1.*"));
+ }
+
+ @Test
+ public void testDescribeCommitMatchAbbrevMax() throws Exception {
+ initialCommitAndTag();
+ secondCommit();
+ assertArrayEquals(new String[] {
+ "v1.0-1-g56f6cebdf3f5ceeecd803365abf0996fb1fa006d", "" },
+ execute("git describe --abbrev 50 --match v1.*"));
+ }
+
+ @Test
public void testDescribeCommitMatch2() throws Exception {
initialCommitAndTag();
secondCommit();