Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't pass TagOpt to FetchProcess, get it from the Transport

We are already passing the transport down.  Its just easier to get
the tagopt off the transport than it is to pass it as an argument
to the constructor.

In the future as we add more options into the Transport we will also
need to obtain those in the FetchProcess, so directly querying the
Transport will be more consistent.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
  • Loading branch information...
commit 1c6e4586db9fa57e158265aa4a24af7eaebfa3b2 1 parent e56d326
@spearce spearce authored robinrosenberg committed
View
7 org.spearce.jgit/src/org/spearce/jgit/transport/FetchProcess.java
@@ -69,9 +69,6 @@
/** List of things we want to fetch from the remote repository. */
private final Collection<RefSpec> toFetch;
- /** How to handle annotated tags, if any are advertised. */
- private final TagOpt tagopt;
-
/** Set of refs we will actually wind up asking to obtain. */
private final HashMap<ObjectId, Ref> askFor = new HashMap<ObjectId, Ref>();
@@ -86,10 +83,9 @@
private FetchConnection conn;
- FetchProcess(final Transport t, final Collection<RefSpec> f, final TagOpt o) {
+ FetchProcess(final Transport t, final Collection<RefSpec> f) {
transport = t;
toFetch = f;
- tagopt = o;
}
void execute(final ProgressMonitor monitor, final FetchResult result)
@@ -114,6 +110,7 @@ void execute(final ProgressMonitor monitor, final FetchResult result)
}
Collection<Ref> additionalTags = Collections.<Ref> emptyList();
+ final TagOpt tagopt = transport.getTagOpt();
if (tagopt == TagOpt.AUTO_FOLLOW)
additionalTags = expandAutoFollowTags();
else if (tagopt == TagOpt.FETCH_TAGS)
View
2  org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
@@ -606,7 +606,7 @@ public FetchResult fetch(final ProgressMonitor monitor,
}
final FetchResult result = new FetchResult();
- new FetchProcess(this, toFetch, tagopt).execute(monitor, result);
+ new FetchProcess(this, toFetch).execute(monitor, result);
return result;
}

0 comments on commit 1c6e458

Please sign in to comment.
Something went wrong with that request. Please try again.