diff options
author | Kaloyan Raev <kaloyan.r@zend.com> | 2013-10-11 11:44:53 +0300 |
---|---|---|
committer | Chris Aniszczyk <caniszczyk@gmail.com> | 2013-10-26 17:25:23 -0400 |
commit | 40e8ba418637fd987745e7ee53ef80332d64647b (patch) | |
tree | 342680769357df99d75dff7d6398811edca12ea0 /org.eclipse.jgit.pgm/src | |
parent | 9b1c965446e0327bc0e408b76b6f1dd655f56352 (diff) | |
download | jgit-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/src')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java | 14 |
1 files changed, 14 insertions, 0 deletions
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); |