From 9c27002c492e29a7f81a97899e779d5778fda796 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Feb 2022 12:04:11 +0100 Subject: [pgm] Add describe --abbrev option Change-Id: I8adf2fad21db71b43266d3f274143eee6bc9dce2 --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'org.eclipse.jgit.pgm/src') 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 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(); -- cgit v1.2.3