summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMathias Kinzler2011-01-26 14:03:02 (EST)
committer Mathias Kinzler2011-01-26 14:03:02 (EST)
commita5b36ae1ea9d8be10fe72f8001bf246a7d4999eb (patch)
tree06ce7f4e657ec5fe0985f0e953a9d0b7d0af2ccc
parent0d7dd6625a11a149d83e17f1d7defab9237aa6f6 (diff)
downloadjgit-a5b36ae1ea9d8be10fe72f8001bf246a7d4999eb.zip
jgit-a5b36ae1ea9d8be10fe72f8001bf246a7d4999eb.tar.gz
jgit-a5b36ae1ea9d8be10fe72f8001bf246a7d4999eb.tar.bz2
FetchCommand: allow to set "TagOpt"refs/changes/50/2350/2
This is needed for implementing Fetch in EGit using the API. Change-Id: Ibdcc95906ef0f93e3798ae20d4de353fb394f2e2 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
index f15509b..28c2d15 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
@@ -59,6 +59,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.CredentialsProvider;
import org.eclipse.jgit.transport.FetchResult;
import org.eclipse.jgit.transport.RefSpec;
+import org.eclipse.jgit.transport.TagOpt;
import org.eclipse.jgit.transport.Transport;
/**
@@ -89,6 +90,7 @@ public class FetchCommand extends GitCommand<FetchResult> {
private CredentialsProvider credentialsProvider;
+ private TagOpt tagOption;
/**
* @param repo
@@ -123,6 +125,8 @@ public class FetchCommand extends GitCommand<FetchResult> {
transport.setRemoveDeletedRefs(removeDeletedRefs);
transport.setTimeout(timeout);
transport.setDryRun(dryRun);
+ if (tagOption != null)
+ transport.setTagOpt(tagOption);
transport.setFetchThin(thin);
transport.setCredentialsProvider(credentialsProvider);
@@ -333,4 +337,16 @@ public class FetchCommand extends GitCommand<FetchResult> {
this.credentialsProvider = credentialsProvider;
return this;
}
+
+ /**
+ * Sets the specification of annotated tag behavior during fetch
+ *
+ * @param tagOpt
+ * @return {@code this}
+ */
+ public FetchCommand setTagOpt(TagOpt tagOpt) {
+ checkCallable();
+ this.tagOption = tagOpt;
+ return this;
+ }
}