"want f900c8326a43303685c46b279b9f70411bff1a4b",
"have 554f6e41067b9e3e565b6988a8294fac1cb78f4b",
"have abc760ab9ad72f08209943251b36cb886a578f87", "done",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
FetchV2Request request = parser.parseFetchRequest(pckIn);
"deepen-relative",
"shallow 28274d02c489f4c7e68153056e9061a46f62d7a0",
"shallow 145e683b229dcab9d0e2ccb01b386f9ecc17d29d",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
FetchV2Request request = parser.parseFetchRequest(pckIn);
"shallow 28274d02c489f4c7e68153056e9061a46f62d7a0",
"shallow 145e683b229dcab9d0e2ccb01b386f9ecc17d29d",
"deepen-not a08595f76159b09d57553e37a5123f1091bb13e7",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
FetchV2Request request = parser.parseFetchRequest(pckIn);
"shallow 28274d02c489f4c7e68153056e9061a46f62d7a0",
"shallow 145e683b229dcab9d0e2ccb01b386f9ecc17d29d",
"deepen-since 123123123",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
FetchV2Request request = parser.parseFetchRequest(pckIn);
public void testFetchWithNoneFilter() throws IOException {
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
"filter blob:none",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.start().allowFilter().done());
FetchV2Request request = parser.parseFetchRequest(pckIn);
public void testFetchWithBlobSizeFilter() throws IOException {
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
"filter blob:limit=15",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.start().allowFilter().done());
FetchV2Request request = parser.parseFetchRequest(pckIn);
public void testFetchWithTreeDepthFilter() throws IOException {
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
"filter tree:3",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.start().allowFilter().done());
FetchV2Request request = parser.parseFetchRequest(pckIn);
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
"filter blob:none",
"filter blob:limit=12",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.start().allowFilter().done());
@Test
public void testFetchFilterWithoutAllowFilter() throws IOException {
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
- "filter blob:limit=12", PacketLineIn.END);
+ "filter blob:limit=12", PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
"want e4980cdc48cfa1301493ca94eb70523f6788b819",
"want-ref refs/heads/branchA",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.start().allowRefInWant().done());
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
"want e4980cdc48cfa1301493ca94eb70523f6788b819",
"want-ref refs/heads/branchC",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.start().allowRefInWant().done());
@Test
public void testLsRefsMinimalReq() throws IOException {
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
@Test
public void testLsRefsSymrefs() throws IOException {
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(), "symrefs",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
PacketLineIn pckIn = formatAsPacketLine(
PacketLineIn.delimiter(),
"peel",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
public void testLsRefsRefPrefixes() throws IOException {
PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.delimiter(),
"ref-prefix refs/for", "ref-prefix refs/heads",
- PacketLineIn.END);
+ PacketLineIn.end());
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
public void testV2Capabilities() throws Exception {
TestV2Hook hook = new TestV2Hook();
ByteArrayInputStream recvStream =
- uploadPackV2Setup(null, null, hook, PacketLineIn.END);
+ uploadPackV2Setup(null, null, hook, PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(hook.capabilitiesRequest, notNullValue());
assertThat(pckIn.readString(), is("version 2"));
public void testV2CapabilitiesAllowFilter() throws Exception {
server.getConfig().setBoolean("uploadpack", null, "allowfilter", true);
ByteArrayInputStream recvStream =
- uploadPackV2Setup(null, null, null, PacketLineIn.END);
+ uploadPackV2Setup(null, null, null, PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("version 2"));
public void testV2CapabilitiesRefInWant() throws Exception {
server.getConfig().setBoolean("uploadpack", null, "allowrefinwant", true);
ByteArrayInputStream recvStream =
- uploadPackV2Setup(null, null, null, PacketLineIn.END);
+ uploadPackV2Setup(null, null, null, PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("version 2"));
public void testV2CapabilitiesRefInWantNotAdvertisedIfUnallowed() throws Exception {
server.getConfig().setBoolean("uploadpack", null, "allowrefinwant", false);
ByteArrayInputStream recvStream =
- uploadPackV2Setup(null, null, null, PacketLineIn.END);
+ uploadPackV2Setup(null, null, null, PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("version 2"));
server.getConfig().setBoolean("uploadpack", null, "allowrefinwant", true);
server.getConfig().setBoolean("uploadpack", null, "advertiserefinwant", false);
ByteArrayInputStream recvStream =
- uploadPackV2Setup(null, null, null, PacketLineIn.END);
+ uploadPackV2Setup(null, null, null, PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("version 2"));
@Test
public void testV2EmptyRequest() throws Exception {
- ByteArrayInputStream recvStream = uploadPackV2(PacketLineIn.END);
+ ByteArrayInputStream recvStream = uploadPackV2(PacketLineIn.end());
// Verify that there is nothing more after the capability
// advertisement.
assertEquals(0, recvStream.available());
TestV2Hook hook = new TestV2Hook();
ByteArrayInputStream recvStream = uploadPackV2(null, null, hook,
- "command=ls-refs\n", PacketLineIn.END);
+ "command=ls-refs\n", PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(hook.lsRefsRequest, notNullValue());
RevTag tag = remote.tag("tag", tip);
remote.update("refs/tags/tag", tag);
- ByteArrayInputStream recvStream = uploadPackV2("command=ls-refs\n", PacketLineIn.delimiter(), "symrefs", PacketLineIn.END);
+ ByteArrayInputStream recvStream = uploadPackV2("command=ls-refs\n",
+ PacketLineIn.delimiter(), "symrefs", PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is(tip.toObjectId().getName() + " HEAD symref-target:refs/heads/master"));
RevTag tag = remote.tag("tag", tip);
remote.update("refs/tags/tag", tag);
- ByteArrayInputStream recvStream = uploadPackV2("command=ls-refs\n", PacketLineIn.delimiter(), "peel", PacketLineIn.END);
+ ByteArrayInputStream recvStream = uploadPackV2("command=ls-refs\n",
+ PacketLineIn.delimiter(), "peel", PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is(tip.toObjectId().getName() + " HEAD"));
remote.update("refs/tags/tag", tag);
ByteArrayInputStream recvStream = uploadPackV2(
- "command=ls-refs\n", PacketLineIn.delimiter(), "symrefs", "peel", PacketLineIn.END,
- "command=ls-refs\n", PacketLineIn.delimiter(), PacketLineIn.END);
+ "command=ls-refs\n", PacketLineIn.delimiter(), "symrefs",
+ "peel", PacketLineIn.end(), "command=ls-refs\n",
+ PacketLineIn.delimiter(), PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is(tip.toObjectId().getName() + " HEAD symref-target:refs/heads/master"));
PacketLineIn.delimiter(),
"ref-prefix refs/heads/maste",
"ref-prefix refs/heads/other",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is(tip.toObjectId().getName() + " refs/heads/master"));
PacketLineIn.delimiter(),
"ref-prefix refs/heads/maste",
"ref-prefix r",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is(tip.toObjectId().getName() + " refs/heads/master"));
"command=ls-refs\n",
PacketLineIn.delimiter(),
"invalid-argument\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
String[] lines = { "command=ls-refs\n",
"server-option=one\n", "server-option=two\n",
PacketLineIn.delimiter(),
- PacketLineIn.END };
+ PacketLineIn.end() };
TestV2Hook testHook = new TestV2Hook();
uploadPackV2Setup(null, null, testHook, lines);
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + advertized.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
// This doesn't
thrown.expect(TransportException.class);
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + unadvertized.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + reachable.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
// This doesn't
thrown.expect(TransportException.class);
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + unreachable.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + tip.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
// This doesn't
thrown.expect(TransportException.class);
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + parentOfTip.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + parentOfTip.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
// This doesn't
thrown.expect(TransportException.class);
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + unreachable.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
"command=fetch\n",
PacketLineIn.delimiter(),
"want " + unreachable.name() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
"want " + fooChild.toObjectId().getName() + "\n",
"want " + barChild.toObjectId().getName() + "\n",
"have " + fooParent.toObjectId().getName() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("acknowledgments"));
"want " + barChild.toObjectId().getName() + "\n",
"have " + fooParent.toObjectId().getName() + "\n",
"have " + barParent.toObjectId().getName() + "\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("acknowledgments"));
"want " + barChild.toObjectId().getName() + "\n",
"have " + fooParent.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
"have " + parent.toObjectId().getName() + "\n",
"thin-pack\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
PacketLineIn.delimiter(),
"want " + commit.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream, new TextProgressMonitor(sw));
"want " + commit.toObjectId().getName() + "\n",
"no-progress\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream, new TextProgressMonitor(sw));
PacketLineIn.delimiter(),
"want " + commit.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream);
"want " + commit.toObjectId().getName() + "\n",
"include-tag\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream);
PacketLineIn.delimiter(),
"want " + child.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
ReceivedPackStatistics receivedStats = parsePack(recvStream);
"want " + child.toObjectId().getName() + "\n",
"ofs-delta\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
receivedStats = parsePack(recvStream);
"want " + barChild.toObjectId().getName() + "\n",
"have " + fooChild.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream);
"have " + fooChild.toObjectId().getName() + "\n",
"shallow " + fooChild.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream);
"want " + child.toObjectId().getName() + "\n",
"deepen 1\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("shallow-info"));
assertThat(pckIn.readString(), is("shallow " + child.toObjectId().getName()));
PacketLineIn.delimiter(),
"want " + child.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream);
PacketLineIn.delimiter(),
"want " + child.toObjectId().getName() + "\n",
"deepen 1\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
// Verify that only the correct section is sent. "shallow-info"
"want " + merge.toObjectId().getName() + "\n",
"have " + boundary.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("shallow-info"));
"want " + child1.toObjectId().getName() + "\n",
"want " + child2.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("shallow-info"));
"deepen-since 1510000\n",
"want " + tooOld.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
"want " + merge.toObjectId().getName() + "\n",
"have " + three.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("shallow-info"));
"deepen-not four\n",
"want " + two.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
"deepen-not twotag\n",
"want " + four.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("shallow-info"));
assertThat(pckIn.readString(), is("shallow " + three.toObjectId().getName()));
"want " + child1.toObjectId().getName() + "\n",
"want " + child2.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("shallow-info"));
"command=fetch\n",
PacketLineIn.delimiter(),
"invalid-argument\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
public void testV2FetchServerOptions() throws Exception {
String[] lines = { "command=fetch\n", "server-option=one\n",
"server-option=two\n", PacketLineIn.delimiter(),
- PacketLineIn.END };
+ PacketLineIn.end() };
TestV2Hook testHook = new TestV2Hook();
uploadPackV2Setup(null, null, testHook, lines);
"want " + commit.toObjectId().getName() + "\n",
"filter blob:limit=5\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream);
}
input.add("filter tree:" + depth + "\n");
input.add("done\n");
- input.add(PacketLineIn.END);
+ input.add(PacketLineIn.end());
ByteArrayInputStream recvStream =
uploadPackV2(RequestPolicy.ANY, /*refFilter=*/null,
/*hook=*/null, input.toArray(new String[0]));
"want " + commit.toObjectId().getName() + "\n",
"filter blob:limit=5\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
}
@Test
PacketLineIn.delimiter(),
"want-ref refs/heads/one\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
} catch (PackProtocolException e) {
assertThat(
e.getMessage(),
"want-ref refs/heads/one\n",
"want-ref refs/heads/two\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("wanted-refs"));
assertThat(
"want-ref refs/heads/one\n",
"want-ref refs/heads/nonExistentRef\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
} catch (PackProtocolException e) {
assertThat(
e.getMessage(),
"want-ref refs/heads/one\n",
"want " + two.toObjectId().getName() + "\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("wanted-refs"));
assertThat(
"want-ref refs/heads/one\n",
"have " + one.toObjectId().getName(),
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
// The client still needs to know the hash of the object that
"want-ref refs/heads/branch1\n",
"deepen 1\n",
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
// shallow-info appears first, then wanted-refs.
"shallow 0123012301230123012301230123012301230123",
"shallow " + two.getName() + '\n',
"done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(pckIn.readString(), is("shallow-info"));
UploadPack up = new UploadPack(server);
ByteArrayInputStream send = linesAsInputStream(
"want " + one.getName() + " agent=JGit-test/1.2.3\n",
- PacketLineIn.END,
+ PacketLineIn.end(),
"have 11cedf1b796d44207da702f7d420684022fc0f09\n", "done\n");
ByteArrayOutputStream recv = new ByteArrayOutputStream();
"command=fetch\n", "agent=JGit-test/1.2.4\n",
PacketLineIn.delimiter(), "want " + one.getName() + "\n",
"have 11cedf1b796d44207da702f7d420684022fc0f09\n", "done\n",
- PacketLineIn.END);
+ PacketLineIn.end());
ByteArrayOutputStream recv = new ByteArrayOutputStream();
up.upload(send, recv, null);