summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java14
2 files changed, 16 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
index 4c36833fa0..1212d93652 100644
--- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
+++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
@@ -315,6 +315,8 @@ usage_showNotes=Add this ref to the list of note branches from which notes are d
usage_squash=Squash commits as if a real merge happened, but do not make a commit or move the HEAD.
usage_srcPrefix=show the source prefix instead of "a/"
usage_symbolicVersionForTheProject=Symbolic version for the project
+usage_tags=fetch all tags
+usage_notags=do not fetch tags
usage_tagMessage=tag message
usage_updateRemoteRefsFromAnotherRepository=Update remote refs from another repository
usage_useNameInsteadOfOriginToTrackUpstream=use <name> instead of 'origin' to track upstream
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
index cc7a4357f5..8e3ec03c74 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
@@ -53,6 +53,7 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.TextProgressMonitor;
import org.eclipse.jgit.transport.FetchResult;
import org.eclipse.jgit.transport.RefSpec;
+import org.eclipse.jgit.transport.TagOpt;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
@@ -86,6 +87,15 @@ class Fetch extends AbstractFetchCommand {
@Option(name = "--quiet", usage = "usage_quiet")
private Boolean quiet;
+ @Option(name = "--tags", usage="usage_tags", aliases = { "-t" })
+ private Boolean tags;
+
+ @Option(name = "--no-tags", usage = "usage_notags", aliases = { "-n" })
+ void notags(@SuppressWarnings("unused")
+ final boolean ignored) {
+ tags = Boolean.FALSE;
+ }
+
@Argument(index = 0, metaVar = "metaVar_uriish")
private String remote = Constants.DEFAULT_REMOTE_NAME;
@@ -102,6 +112,10 @@ class Fetch extends AbstractFetchCommand {
fetch.setRemoveDeletedRefs(prune.booleanValue());
if (toget != null)
fetch.setRefSpecs(toget);
+ if (tags != null) {
+ fetch.setTagOpt(tags.booleanValue() ? TagOpt.FETCH_TAGS
+ : TagOpt.NO_TAGS);
+ }
if (0 <= timeout)
fetch.setTimeout(timeout);
fetch.setDryRun(dryRun);