[JGIT PATCH 5/6] Don't pass TagOpt to FetchProcess, get it from the Transport

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 .../org/spearce/jgit/transport/FetchProcess.java   |    7 ++-----
 .../src/org/spearce/jgit/transport/Transport.java  |    2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/FetchProcess.java b/org.spearce.jgit/src/org/spearce/jgit/transport/FetchProcess.java
index 09718eb..2ca8aeb 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/FetchProcess.java
+++ b/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)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
index 28700b7..e58b72a 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
+++ b/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;
 	}
 
-- 
1.6.2.rc0.226.gf08f

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux