Merge "Always fetch tags during clone"

This commit is contained in:
Chris Aniszczyk 2011-03-14 17:33:36 -04:00 committed by Code Review
commit b4b5178e82
2 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,7 @@
import org.eclipse.jgit.transport.FetchResult;
import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.jgit.transport.TagOpt;
import org.eclipse.jgit.transport.Transport;
import org.eclipse.jgit.transport.URIish;
import org.kohsuke.args4j.Argument;
@ -143,6 +144,7 @@ private FetchResult runFetch() throws NotSupportedException,
final Transport tn = Transport.open(db, remoteName);
final FetchResult r;
try {
tn.setTagOpt(TagOpt.FETCH_TAGS);
r = tn.fetch(new TextProgressMonitor(), null);
} finally {
tn.close();

View File

@ -66,6 +66,7 @@
import org.eclipse.jgit.transport.FetchResult;
import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.jgit.transport.TagOpt;
import org.eclipse.jgit.transport.URIish;
/**
@ -149,6 +150,7 @@ private FetchResult fetch(Repository repo, URIish u)
FetchCommand command = new FetchCommand(repo);
command.setRemote(remote);
command.setProgressMonitor(monitor);
command.setTagOpt(TagOpt.FETCH_TAGS);
if (credentialsProvider != null)
command.setCredentialsProvider(credentialsProvider);
return command.call();