@ -608,7 +608,7 @@ public class UploadPackTest {
RevTag tag = remote . tag ( "tag" , tip ) ;
RevTag tag = remote . tag ( "tag" , tip ) ;
remote . update ( "refs/tags/tag" , tag ) ;
remote . update ( "refs/tags/tag" , tag ) ;
ByteArrayInputStream recvStream = uploadPackV2 ( "command=ls-refs\n" , PacketLineIn . DELIM , "symrefs" , PacketLineIn . END ) ;
ByteArrayInputStream recvStream = uploadPackV2 ( "command=ls-refs\n" , PacketLineIn . delimiter ( ) , "symrefs" , PacketLineIn . END ) ;
PacketLineIn pckIn = new PacketLineIn ( recvStream ) ;
PacketLineIn pckIn = new PacketLineIn ( recvStream ) ;
assertThat ( pckIn . readString ( ) , is ( tip . toObjectId ( ) . getName ( ) + " HEAD symref-target:refs/heads/master" ) ) ;
assertThat ( pckIn . readString ( ) , is ( tip . toObjectId ( ) . getName ( ) + " HEAD symref-target:refs/heads/master" ) ) ;
@ -625,7 +625,7 @@ public class UploadPackTest {
RevTag tag = remote . tag ( "tag" , tip ) ;
RevTag tag = remote . tag ( "tag" , tip ) ;
remote . update ( "refs/tags/tag" , tag ) ;
remote . update ( "refs/tags/tag" , tag ) ;
ByteArrayInputStream recvStream = uploadPackV2 ( "command=ls-refs\n" , PacketLineIn . DELIM , "peel" , PacketLineIn . END ) ;
ByteArrayInputStream recvStream = uploadPackV2 ( "command=ls-refs\n" , PacketLineIn . delimiter ( ) , "peel" , PacketLineIn . END ) ;
PacketLineIn pckIn = new PacketLineIn ( recvStream ) ;
PacketLineIn pckIn = new PacketLineIn ( recvStream ) ;
assertThat ( pckIn . readString ( ) , is ( tip . toObjectId ( ) . getName ( ) + " HEAD" ) ) ;
assertThat ( pckIn . readString ( ) , is ( tip . toObjectId ( ) . getName ( ) + " HEAD" ) ) ;
@ -646,8 +646,8 @@ public class UploadPackTest {
remote . update ( "refs/tags/tag" , tag ) ;
remote . update ( "refs/tags/tag" , tag ) ;
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=ls-refs\n" , PacketLineIn . DELIM , "symrefs" , "peel" , PacketLineIn . END ,
"command=ls-refs\n" , PacketLineIn . delimiter ( ) , "symrefs" , "peel" , PacketLineIn . END ,
"command=ls-refs\n" , PacketLineIn . DELIM , PacketLineIn . END ) ;
"command=ls-refs\n" , PacketLineIn . delimiter ( ) , PacketLineIn . END ) ;
PacketLineIn pckIn = new PacketLineIn ( recvStream ) ;
PacketLineIn pckIn = new PacketLineIn ( recvStream ) ;
assertThat ( pckIn . readString ( ) , is ( tip . toObjectId ( ) . getName ( ) + " HEAD symref-target:refs/heads/master" ) ) ;
assertThat ( pckIn . readString ( ) , is ( tip . toObjectId ( ) . getName ( ) + " HEAD symref-target:refs/heads/master" ) ) ;
@ -672,7 +672,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=ls-refs\n" ,
"command=ls-refs\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"ref-prefix refs/heads/maste" ,
"ref-prefix refs/heads/maste" ,
"ref-prefix refs/heads/other" ,
"ref-prefix refs/heads/other" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -691,7 +691,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=ls-refs\n" ,
"command=ls-refs\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"ref-prefix refs/heads/maste" ,
"ref-prefix refs/heads/maste" ,
"ref-prefix r" ,
"ref-prefix r" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -708,7 +708,7 @@ public class UploadPackTest {
thrown . expectMessage ( "unexpected invalid-argument" ) ;
thrown . expectMessage ( "unexpected invalid-argument" ) ;
uploadPackV2 (
uploadPackV2 (
"command=ls-refs\n" ,
"command=ls-refs\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"invalid-argument\n" ,
"invalid-argument\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
}
}
@ -717,7 +717,7 @@ public class UploadPackTest {
public void testV2LsRefsServerOptions ( ) throws Exception {
public void testV2LsRefsServerOptions ( ) throws Exception {
String [ ] lines = { "command=ls-refs\n" ,
String [ ] lines = { "command=ls-refs\n" ,
"server-option=one\n" , "server-option=two\n" ,
"server-option=one\n" , "server-option=two\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
PacketLineIn . END } ;
PacketLineIn . END } ;
TestV2Hook testHook = new TestV2Hook ( ) ;
TestV2Hook testHook = new TestV2Hook ( ) ;
@ -762,7 +762,7 @@ public class UploadPackTest {
null ,
null ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + advertized . name ( ) + "\n" ,
"want " + advertized . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -775,7 +775,7 @@ public class UploadPackTest {
null ,
null ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + unadvertized . name ( ) + "\n" ,
"want " + unadvertized . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
}
}
@ -793,7 +793,7 @@ public class UploadPackTest {
null ,
null ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + reachable . name ( ) + "\n" ,
"want " + reachable . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -806,7 +806,7 @@ public class UploadPackTest {
null ,
null ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + unreachable . name ( ) + "\n" ,
"want " + unreachable . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
}
}
@ -823,7 +823,7 @@ public class UploadPackTest {
new RejectAllRefFilter ( ) ,
new RejectAllRefFilter ( ) ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + tip . name ( ) + "\n" ,
"want " + tip . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -836,7 +836,7 @@ public class UploadPackTest {
new RejectAllRefFilter ( ) ,
new RejectAllRefFilter ( ) ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + parentOfTip . name ( ) + "\n" ,
"want " + parentOfTip . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
}
}
@ -854,7 +854,7 @@ public class UploadPackTest {
new RejectAllRefFilter ( ) ,
new RejectAllRefFilter ( ) ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + parentOfTip . name ( ) + "\n" ,
"want " + parentOfTip . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -867,7 +867,7 @@ public class UploadPackTest {
new RejectAllRefFilter ( ) ,
new RejectAllRefFilter ( ) ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + unreachable . name ( ) + "\n" ,
"want " + unreachable . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
}
}
@ -882,7 +882,7 @@ public class UploadPackTest {
null ,
null ,
null ,
null ,
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + unreachable . name ( ) + "\n" ,
"want " + unreachable . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
}
}
@ -898,7 +898,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooParent . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooParent . toObjectId ( ) . getName ( ) + "\n" ,
@ -921,7 +921,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooParent . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooParent . toObjectId ( ) . getName ( ) + "\n" ,
@ -956,7 +956,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooParent . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooParent . toObjectId ( ) . getName ( ) + "\n" ,
@ -985,7 +985,7 @@ public class UploadPackTest {
// Pretend that we have parent to get a thin pack based on it.
// Pretend that we have parent to get a thin pack based on it.
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"have " + parent . toObjectId ( ) . getName ( ) + "\n" ,
"have " + parent . toObjectId ( ) . getName ( ) + "\n" ,
"thin-pack\n" ,
"thin-pack\n" ,
@ -1011,7 +1011,7 @@ public class UploadPackTest {
StringWriter sw = new StringWriter ( ) ;
StringWriter sw = new StringWriter ( ) ;
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -1024,7 +1024,7 @@ public class UploadPackTest {
sw = new StringWriter ( ) ;
sw = new StringWriter ( ) ;
recvStream = uploadPackV2 (
recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"no-progress\n" ,
"no-progress\n" ,
"done\n" ,
"done\n" ,
@ -1045,7 +1045,7 @@ public class UploadPackTest {
// Without include-tag.
// Without include-tag.
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -1057,7 +1057,7 @@ public class UploadPackTest {
// With tag.
// With tag.
recvStream = uploadPackV2 (
recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"include-tag\n" ,
"include-tag\n" ,
"done\n" ,
"done\n" ,
@ -1081,7 +1081,7 @@ public class UploadPackTest {
// Without ofs-delta.
// Without ofs-delta.
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -1093,7 +1093,7 @@ public class UploadPackTest {
// With ofs-delta.
// With ofs-delta.
recvStream = uploadPackV2 (
recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"ofs-delta\n" ,
"ofs-delta\n" ,
"done\n" ,
"done\n" ,
@ -1115,7 +1115,7 @@ public class UploadPackTest {
// commonParent, so it doesn't send it.
// commonParent, so it doesn't send it.
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
@ -1130,7 +1130,7 @@ public class UploadPackTest {
// commonParent, so it sends it.
// commonParent, so it sends it.
recvStream = uploadPackV2 (
recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"want " + barChild . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"have " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"shallow " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
"shallow " + fooChild . toObjectId ( ) . getName ( ) + "\n" ,
@ -1151,7 +1151,7 @@ public class UploadPackTest {
// "deepen 1" sends only the child.
// "deepen 1" sends only the child.
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"deepen 1\n" ,
"deepen 1\n" ,
"done\n" ,
"done\n" ,
@ -1168,7 +1168,7 @@ public class UploadPackTest {
// Without that, the parent is sent too.
// Without that, the parent is sent too.
recvStream = uploadPackV2 (
recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -1186,7 +1186,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"deepen 1\n" ,
"deepen 1\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -1218,7 +1218,7 @@ public class UploadPackTest {
// Report that we only have "boundary" as a shallow boundary.
// Report that we only have "boundary" as a shallow boundary.
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"shallow " + boundary . toObjectId ( ) . getName ( ) + "\n" ,
"shallow " + boundary . toObjectId ( ) . getName ( ) + "\n" ,
"deepen-since 1510000\n" ,
"deepen-since 1510000\n" ,
"want " + merge . toObjectId ( ) . getName ( ) + "\n" ,
"want " + merge . toObjectId ( ) . getName ( ) + "\n" ,
@ -1269,7 +1269,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"deepen-since 1510000\n" ,
"deepen-since 1510000\n" ,
"want " + child1 . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child1 . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child2 . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child2 . toObjectId ( ) . getName ( ) + "\n" ,
@ -1308,7 +1308,7 @@ public class UploadPackTest {
thrown . expectMessage ( "No commits selected for shallow request" ) ;
thrown . expectMessage ( "No commits selected for shallow request" ) ;
uploadPackV2 (
uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"deepen-since 1510000\n" ,
"deepen-since 1510000\n" ,
"want " + tooOld . toObjectId ( ) . getName ( ) + "\n" ,
"want " + tooOld . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
@ -1331,7 +1331,7 @@ public class UploadPackTest {
// wants "merge" while excluding "side".
// wants "merge" while excluding "side".
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"shallow " + three . toObjectId ( ) . getName ( ) + "\n" ,
"shallow " + three . toObjectId ( ) . getName ( ) + "\n" ,
"deepen-not side\n" ,
"deepen-not side\n" ,
"want " + merge . toObjectId ( ) . getName ( ) + "\n" ,
"want " + merge . toObjectId ( ) . getName ( ) + "\n" ,
@ -1384,7 +1384,7 @@ public class UploadPackTest {
thrown . expectMessage ( "No commits selected for shallow request" ) ;
thrown . expectMessage ( "No commits selected for shallow request" ) ;
uploadPackV2 (
uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"deepen-not four\n" ,
"deepen-not four\n" ,
"want " + two . toObjectId ( ) . getName ( ) + "\n" ,
"want " + two . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
@ -1404,7 +1404,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"deepen-not twotag\n" ,
"deepen-not twotag\n" ,
"want " + four . toObjectId ( ) . getName ( ) + "\n" ,
"want " + four . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
@ -1438,7 +1438,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"deepen-not base\n" ,
"deepen-not base\n" ,
"want " + child1 . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child1 . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child2 . toObjectId ( ) . getName ( ) + "\n" ,
"want " + child2 . toObjectId ( ) . getName ( ) + "\n" ,
@ -1470,7 +1470,7 @@ public class UploadPackTest {
thrown . expectMessage ( "unexpected invalid-argument" ) ;
thrown . expectMessage ( "unexpected invalid-argument" ) ;
uploadPackV2 (
uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"invalid-argument\n" ,
"invalid-argument\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
}
}
@ -1478,7 +1478,7 @@ public class UploadPackTest {
@Test
@Test
public void testV2FetchServerOptions ( ) throws Exception {
public void testV2FetchServerOptions ( ) throws Exception {
String [ ] lines = { "command=fetch\n" , "server-option=one\n" ,
String [ ] lines = { "command=fetch\n" , "server-option=one\n" ,
"server-option=two\n" , PacketLineIn . DELIM ,
"server-option=two\n" , PacketLineIn . delimiter ( ) ,
PacketLineIn . END } ;
PacketLineIn . END } ;
TestV2Hook testHook = new TestV2Hook ( ) ;
TestV2Hook testHook = new TestV2Hook ( ) ;
@ -1503,7 +1503,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"filter blob:limit=5\n" ,
"filter blob:limit=5\n" ,
"done\n" ,
"done\n" ,
@ -1558,7 +1558,7 @@ public class UploadPackTest {
List < String > input = new ArrayList < > ( ) ;
List < String > input = new ArrayList < > ( ) ;
input . add ( "command=fetch\n" ) ;
input . add ( "command=fetch\n" ) ;
input . add ( PacketLineIn . DELIM ) ;
input . add ( PacketLineIn . delimiter ( ) ) ;
for ( ObjectId want : wants ) {
for ( ObjectId want : wants ) {
input . add ( "want " + want . getName ( ) + "\n" ) ;
input . add ( "want " + want . getName ( ) + "\n" ) ;
}
}
@ -1845,7 +1845,7 @@ public class UploadPackTest {
thrown . expectMessage ( "unexpected filter blob:limit=5" ) ;
thrown . expectMessage ( "unexpected filter blob:limit=5" ) ;
uploadPackV2 (
uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"filter blob:limit=5\n" ,
"filter blob:limit=5\n" ,
"done\n" ,
"done\n" ,
@ -1860,7 +1860,7 @@ public class UploadPackTest {
try {
try {
uploadPackV2 (
uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want-ref refs/heads/one\n" ,
"want-ref refs/heads/one\n" ,
"done\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;
@ -1886,7 +1886,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want-ref refs/heads/one\n" ,
"want-ref refs/heads/one\n" ,
"want-ref refs/heads/two\n" ,
"want-ref refs/heads/two\n" ,
"done\n" ,
"done\n" ,
@ -1917,7 +1917,7 @@ public class UploadPackTest {
try {
try {
uploadPackV2 (
uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want-ref refs/heads/one\n" ,
"want-ref refs/heads/one\n" ,
"want-ref refs/heads/nonExistentRef\n" ,
"want-ref refs/heads/nonExistentRef\n" ,
"done\n" ,
"done\n" ,
@ -1944,7 +1944,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want-ref refs/heads/one\n" ,
"want-ref refs/heads/one\n" ,
"want " + two . toObjectId ( ) . getName ( ) + "\n" ,
"want " + two . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
"done\n" ,
@ -1972,7 +1972,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want-ref refs/heads/one\n" ,
"want-ref refs/heads/one\n" ,
"have " + one . toObjectId ( ) . getName ( ) ,
"have " + one . toObjectId ( ) . getName ( ) ,
"done\n" ,
"done\n" ,
@ -2004,7 +2004,7 @@ public class UploadPackTest {
ByteArrayInputStream recvStream = uploadPackV2 (
ByteArrayInputStream recvStream = uploadPackV2 (
"command=fetch\n" ,
"command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want-ref refs/heads/branch1\n" ,
"want-ref refs/heads/branch1\n" ,
"deepen 1\n" ,
"deepen 1\n" ,
"done\n" ,
"done\n" ,
@ -2035,7 +2035,7 @@ public class UploadPackTest {
true ) ;
true ) ;
ByteArrayInputStream recvStream = uploadPackV2 ( "command=fetch\n" ,
ByteArrayInputStream recvStream = uploadPackV2 ( "command=fetch\n" ,
PacketLineIn . DELIM ,
PacketLineIn . delimiter ( ) ,
"want-ref refs/heads/three\n" ,
"want-ref refs/heads/three\n" ,
"deepen 3" ,
"deepen 3" ,
"shallow 0123012301230123012301230123012301230123" ,
"shallow 0123012301230123012301230123012301230123" ,
@ -2091,7 +2091,7 @@ public class UploadPackTest {
ByteArrayInputStream send = linesAsInputStream (
ByteArrayInputStream send = linesAsInputStream (
"command=fetch\n" , "agent=JGit-test/1.2.4\n" ,
"command=fetch\n" , "agent=JGit-test/1.2.4\n" ,
PacketLineIn . DELIM , "want " + one . getName ( ) + "\n" ,
PacketLineIn . delimiter ( ) , "want " + one . getName ( ) + "\n" ,
"have 11cedf1b796d44207da702f7d420684022fc0f09\n" , "done\n" ,
"have 11cedf1b796d44207da702f7d420684022fc0f09\n" , "done\n" ,
PacketLineIn . END ) ;
PacketLineIn . END ) ;