diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2017-02-16 15:57:54 +0900 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-02-18 15:21:26 +0100 |
commit | 1cda4faed425286fe5230a6b2b8454c376ba79f1 (patch) | |
tree | 6ad4162959a1d67bba2424d316f6ede14b2ab3f9 /org.eclipse.jgit/src/org/eclipse/jgit/api | |
parent | 30628e3b86386a7f53d7c9b14d9209ee45cdb1bb (diff) | |
download | jgit-1cda4faed425286fe5230a6b2b8454c376ba79f1.tar.gz jgit-1cda4faed425286fe5230a6b2b8454c376ba79f1.zip |
PullCommand: Allow to set tag behavior
Add a new method setTagOpt which sets the annotated tag behavior during
fetch. Pass the option to the fetch command.
No explicit tests are added; the fetch with tags functionality is already
covered by the tests of the fetch command.
Change-Id: I131e1f68d8fcced178d8fa48abf7ffab17f8e173
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java index a4d9ec1a07..0306548a12 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java @@ -71,6 +71,7 @@ import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryState; import org.eclipse.jgit.merge.MergeStrategy; import org.eclipse.jgit.transport.FetchResult; +import org.eclipse.jgit.transport.TagOpt; /** * The Pull command @@ -92,6 +93,8 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> { private MergeStrategy strategy = MergeStrategy.RECURSIVE; + private TagOpt tagOption; + /** * @param repo */ @@ -272,9 +275,8 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> { JGitText.get().operationCanceled, JGitText.get().pullTaskName)); - FetchCommand fetch = new FetchCommand(repo); - fetch.setRemote(remote); - fetch.setProgressMonitor(monitor); + FetchCommand fetch = new FetchCommand(repo).setRemote(remote) + .setProgressMonitor(monitor).setTagOpt(tagOption); configure(fetch); fetchRes = fetch.call(); @@ -412,6 +414,19 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> { } /** + * Sets the specification of annotated tag behavior during fetch + * + * @param tagOpt + * @return {@code this} + * @Since 4.7 + */ + public PullCommand setTagOpt(TagOpt tagOpt) { + checkCallable(); + this.tagOption = tagOpt; + return this; + } + + /** * Reads the rebase mode to use for a pull command from the repository * configuration. This is the value defined for the configurations * {@code branch.[branchName].rebase}, or,if not set, {@code pull.rebase}. |