diff options
author | Ivan Frade <ifrade@google.com> | 2018-10-16 14:16:35 -0700 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2018-10-16 16:13:04 -0700 |
commit | 81a752bef74bf651fbd6acf24faa2b7ba5f41e5e (patch) | |
tree | aa196db06c67e7cf9adab8ed00d5cda1a9f7accc | |
parent | 3c974d0251e61dd7dd0576dad22c515ed7eb09ff (diff) | |
download | jgit-81a752bef74bf651fbd6acf24faa2b7ba5f41e5e.tar.gz jgit-81a752bef74bf651fbd6acf24faa2b7ba5f41e5e.zip |
UploadPack: Use request instead of field for shallowSince
Change-Id: I1b9fdb6c58c574f66dbd152c1049ddcd52cc1683
Signed-off-by: Ivan Frade <ifrade@google.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 7d5dc88c47..752fa4045a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -305,12 +305,6 @@ public class UploadPack { /** Desired depth from the client on a shallow request. */ private int depth; - /** - * Commit time of the newest objects the client has asked us using - * --shallow-since not to send. Cannot be nonzero if depth is nonzero. - */ - private int shallowSince; - /** Commit time of the oldest common commit, in seconds. */ private int oldestTime; @@ -839,7 +833,7 @@ public class UploadPack { if (!clientShallowCommits.isEmpty()) verifyClientShallow(clientShallowCommits); - if (depth != 0 || shallowSince != 0) { + if (depth != 0 || req.getDeepenSince() != 0) { computeShallowsAndUnshallows(req, shallow -> { pckOut.writeString("shallow " + shallow.name() + '\n'); //$NON-NLS-1$ }, unshallow -> { @@ -960,7 +954,6 @@ public class UploadPack { wantIds = req.getWantIds(); clientShallowCommits = req.getClientShallowCommits(); depth = req.getDepth(); - shallowSince = req.getDeepenSince(); boolean sectionSent = false; boolean mayHaveShallow = req.getDepth() != 0 @@ -1929,11 +1922,11 @@ public class UploadPack { } RevWalk rw = walk; - if (depth > 0 || shallowSince != 0) { + if (depth > 0 || req.getDeepenSince() != 0) { int walkDepth = depth == 0 ? Integer.MAX_VALUE : depth - 1; pw.setShallowPack(depth, unshallowCommits); rw = new DepthWalk.RevWalk(walk.getObjectReader(), walkDepth); - ((DepthWalk.RevWalk) rw).setDeepenSince(shallowSince); + ((DepthWalk.RevWalk) rw).setDeepenSince(req.getDeepenSince()); rw.assumeShallow(clientShallowCommits); } |