aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-04-09 22:49:58 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2023-04-12 13:56:55 +0200
commit0e9708803f8f78efbe53b9b19bd568d50b412b50 (patch)
tree24ba8af5b658e6a596619f4245e5014389254848 /org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm
parent060dcf1ccab6c43e4d5cc19524fafa3e82e351e0 (diff)
downloadjgit-0e9708803f8f78efbe53b9b19bd568d50b412b50.tar.gz
jgit-0e9708803f8f78efbe53b9b19bd568d50b412b50.zip
[pgm] Implement git tag --contains option
Change-Id: I390bcd2c2c563d4b27e1369f09548be59ba7c111
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java9
1 files changed, 9 insertions, 0 deletions
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<Ref> list = command.call();
for (Ref ref : list) {
outw.println(Repository.shortenRefName(ref.getName()));