Browse Source

Merge "Always fetch tags during clone"

stable-0.12
Chris Aniszczyk 14 years ago committed by Code Review
parent
commit
b4b5178e82
  1. 2
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
  2. 2
      org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java

2
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java

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

2
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java

@ -66,6 +66,7 @@ import org.eclipse.jgit.transport.CredentialsProvider;
import org.eclipse.jgit.transport.FetchResult; import org.eclipse.jgit.transport.FetchResult;
import org.eclipse.jgit.transport.RefSpec; import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.transport.RemoteConfig; import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.jgit.transport.TagOpt;
import org.eclipse.jgit.transport.URIish; import org.eclipse.jgit.transport.URIish;
/** /**
@ -149,6 +150,7 @@ public class CloneCommand implements Callable<Git> {
FetchCommand command = new FetchCommand(repo); FetchCommand command = new FetchCommand(repo);
command.setRemote(remote); command.setRemote(remote);
command.setProgressMonitor(monitor); command.setProgressMonitor(monitor);
command.setTagOpt(TagOpt.FETCH_TAGS);
if (credentialsProvider != null) if (credentialsProvider != null)
command.setCredentialsProvider(credentialsProvider); command.setCredentialsProvider(credentialsProvider);
return command.call(); return command.call();

Loading…
Cancel
Save