aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java
diff options
context:
space:
mode:
authorMatthew DeVore <matvore@gmail.com>2019-03-15 18:57:04 -0700
committerMatthew DeVore <matvore@gmail.com>2019-03-22 16:06:22 -0700
commitcc9ca71a166914969b795aeb887a882aa53a2fec (patch)
tree4e6213bbcb7477de0d3dfd4aa179f96946405f54 /org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java
parentcc714d3bbb23d62d3c3239b69bc81a349b2c4c43 (diff)
downloadjgit-cc9ca71a166914969b795aeb887a882aa53a2fec.tar.gz
jgit-cc9ca71a166914969b795aeb887a882aa53a2fec.zip
Put filter spec information in a dedicated object
This increases type-safety and is ground work for support of the "tree:<depth>" filter. Change-Id: Id19eacdcdaddb9132064c642f6d554b1060efe9f Signed-off-by: Matthew DeVore <matvore@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java
index 05f4a8155f..231ab9f2cc 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java
@@ -42,6 +42,8 @@
*/
package org.eclipse.jgit.transport;
+import static java.util.Objects.requireNonNull;
+
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -57,10 +59,11 @@ import org.eclipse.jgit.lib.ObjectId;
final class FetchV0Request extends FetchRequest {
FetchV0Request(@NonNull Set<ObjectId> wantIds, int depth,
- @NonNull Set<ObjectId> clientShallowCommits, long filterBlobLimit,
+ @NonNull Set<ObjectId> clientShallowCommits,
+ @NonNull FilterSpec filterSpec,
@NonNull Set<String> clientCapabilities, @Nullable String agent) {
- super(wantIds, depth, clientShallowCommits, filterBlobLimit,
- clientCapabilities, 0, Collections.emptyList(), agent);
+ super(wantIds, depth, clientShallowCommits, filterSpec,
+ clientCapabilities, 0, Collections.emptyList(), agent);
}
static final class Builder {
@@ -71,7 +74,7 @@ final class FetchV0Request extends FetchRequest {
final Set<ObjectId> clientShallowCommits = new HashSet<>();
- long filterBlobLimit = -1;
+ FilterSpec filterSpec = FilterSpec.NO_FILTER;
final Set<String> clientCaps = new HashSet<>();
@@ -129,18 +132,18 @@ final class FetchV0Request extends FetchRequest {
}
/**
- * @param filterBlobLim
- * blob limit set in a "filter" line
+ * @param filter
+ * the filter set in a filter line
* @return this builder
*/
- Builder setFilterBlobLimit(long filterBlobLim) {
- filterBlobLimit = filterBlobLim;
+ Builder setFilterSpec(@NonNull FilterSpec filter) {
+ filterSpec = requireNonNull(filter);
return this;
}
FetchV0Request build() {
return new FetchV0Request(wantIds, depth, clientShallowCommits,
- filterBlobLimit, clientCaps, agent);
+ filterSpec, clientCaps, agent);
}
}