From 0e9708803f8f78efbe53b9b19bd568d50b412b50 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 9 Apr 2023 22:49:58 +0200 Subject: [pgm] Implement git tag --contains option Change-Id: I390bcd2c2c563d4b27e1369f09548be59ba7c111 --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'org.eclipse.jgit.pgm/src/org/eclipse') diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java index e2cd31d198..0603de18ac 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java @@ -33,6 +33,7 @@ import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.pgm.internal.CLIText; import org.eclipse.jgit.pgm.internal.VerificationUtils; +import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevTag; import org.eclipse.jgit.revwalk.RevWalk; import org.kohsuke.args4j.Argument; @@ -76,6 +77,11 @@ class Tag extends TextBuiltin { "--local-user" }, usage = "usage_tagVerify") private boolean verify; + @Option(name = "--contains", forbids = { "--delete", "--force", + "--annotate", "-m", "--sign", "--no-sign", + "--local-user" }, metaVar = "metaVar_commitish", usage = "usage_tagContains") + private RevCommit contains; + @Argument(index = 0, metaVar = "metaVar_name") private String tagName; @@ -142,6 +148,9 @@ class Tag extends TextBuiltin { } } else { ListTagCommand command = git.tagList(); + if (contains != null) { + command.setContains(contains); + } List list = command.call(); for (Ref ref : list) { outw.println(Repository.shortenRefName(ref.getName())); -- cgit v1.2.3