summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2018-08-13 16:57:25 -0700
committerJonathan Tan <jonathantanmy@google.com>2018-08-13 16:57:25 -0700
commit3227348e5e8feea0248d97ed24d8f1695a14f499 (patch)
tree8a5b70d19bf5128349aa898d79642173a2c7d7d0 /org.eclipse.jgit.test
parentd1dc49e968d75193f3f6d8c14412afa75631825b (diff)
downloadjgit-3227348e5e8feea0248d97ed24d8f1695a14f499.tar.gz
jgit-3227348e5e8feea0248d97ed24d8f1695a14f499.zip
Respond with shallow-info before wanted-refs
When fetching with protocol v2, git expects the shallow-info section to appear before wanted-refs if both appear in the response. Teach UploadPack to do this. Change-Id: Ie26a91edcce5d27a1d727d7fba5c30e1144e118b Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
index 7ef713bf45..9c43c0b0a4 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
@@ -1367,13 +1367,13 @@ public class UploadPackTest {
PacketLineIn.END);
PacketLineIn pckIn = new PacketLineIn(recvStream);
- // wanted-refs appears first, then shallow-info.
- assertThat(pckIn.readString(), is("wanted-refs"));
- assertThat(pckIn.readString(), is(child.toObjectId().getName() + " refs/heads/branch1"));
- assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
+ // shallow-info appears first, then wanted-refs.
assertThat(pckIn.readString(), is("shallow-info"));
assertThat(pckIn.readString(), is("shallow " + child.toObjectId().getName()));
assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
+ assertThat(pckIn.readString(), is("wanted-refs"));
+ assertThat(pckIn.readString(), is(child.toObjectId().getName() + " refs/heads/branch1"));
+ assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream);
assertTrue(client.hasObject(child.toObjectId()));