aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
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/src
parent85d8b31cb25e779f2511d96e0dd1a0606512e8b4 (diff)
downloadjgit-9c27002c492e29a7f81a97899e779d5778fda796.tar.gz
jgit-9c27002c492e29a7f81a97899e779d5778fda796.zip
[pgm] Add describe --abbrev option
Change-Id: I8adf2fad21db71b43266d3f274143eee6bc9dce2
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java
index 8aa119a358..116db037d4 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java
@@ -44,6 +44,9 @@ class Describe extends TextBuiltin {
@Option(name = "--match", usage = "usage_Match", metaVar = "metaVar_pattern")
private List<String> patterns = new ArrayList<>();
+ @Option(name = "--abbrev", usage = "usage_Abbrev")
+ private Integer abbrev;
+
/** {@inheritDoc} */
@Override
protected void run() {
@@ -57,6 +60,9 @@ class Describe extends TextBuiltin {
cmd.setTags(useTags);
cmd.setAlways(always);
cmd.setMatch(patterns.toArray(new String[0]));
+ if (abbrev != null) {
+ cmd.setAbbrev(abbrev.intValue());
+ }
String result = null;
try {
result = cmd.call();