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>
This commit is contained in:
parent
30628e3b86
commit
1cda4faed4
|
@ -71,6 +71,7 @@
|
||||||
import org.eclipse.jgit.lib.RepositoryState;
|
import org.eclipse.jgit.lib.RepositoryState;
|
||||||
import org.eclipse.jgit.merge.MergeStrategy;
|
import org.eclipse.jgit.merge.MergeStrategy;
|
||||||
import org.eclipse.jgit.transport.FetchResult;
|
import org.eclipse.jgit.transport.FetchResult;
|
||||||
|
import org.eclipse.jgit.transport.TagOpt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Pull command
|
* The Pull command
|
||||||
|
@ -92,6 +93,8 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> {
|
||||||
|
|
||||||
private MergeStrategy strategy = MergeStrategy.RECURSIVE;
|
private MergeStrategy strategy = MergeStrategy.RECURSIVE;
|
||||||
|
|
||||||
|
private TagOpt tagOption;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param repo
|
* @param repo
|
||||||
*/
|
*/
|
||||||
|
@ -272,9 +275,8 @@ public PullResult call() throws GitAPIException,
|
||||||
JGitText.get().operationCanceled,
|
JGitText.get().operationCanceled,
|
||||||
JGitText.get().pullTaskName));
|
JGitText.get().pullTaskName));
|
||||||
|
|
||||||
FetchCommand fetch = new FetchCommand(repo);
|
FetchCommand fetch = new FetchCommand(repo).setRemote(remote)
|
||||||
fetch.setRemote(remote);
|
.setProgressMonitor(monitor).setTagOpt(tagOption);
|
||||||
fetch.setProgressMonitor(monitor);
|
|
||||||
configure(fetch);
|
configure(fetch);
|
||||||
|
|
||||||
fetchRes = fetch.call();
|
fetchRes = fetch.call();
|
||||||
|
@ -411,6 +413,19 @@ public PullCommand setStrategy(MergeStrategy strategy) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Reads the rebase mode to use for a pull command from the repository
|
||||||
* configuration. This is the value defined for the configurations
|
* configuration. This is the value defined for the configurations
|
||||||
|
|
Loading…
Reference in New Issue