summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorKaloyan Raev <kaloyan.r@zend.com>2013-10-11 11:44:53 +0300
committerChris Aniszczyk <caniszczyk@gmail.com>2013-10-26 17:25:23 -0400
commit40e8ba418637fd987745e7ee53ef80332d64647b (patch)
tree342680769357df99d75dff7d6398811edca12ea0 /org.eclipse.jgit.pgm
parent9b1c965446e0327bc0e408b76b6f1dd655f56352 (diff)
downloadjgit-40e8ba418637fd987745e7ee53ef80332d64647b.tar.gz
jgit-40e8ba418637fd987745e7ee53ef80332d64647b.zip
CLI fetch command should support --tags
Bug: 419638 Change-Id: I1dc99fd38e678e091a1d141d741328f0dec1756a Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
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);