@ -489,7 +489,7 @@ public class UploadPackTest {
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" ) ) ;
@ -510,7 +510,7 @@ public class UploadPackTest {
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" ) ) ;
@ -527,7 +527,7 @@ public class UploadPackTest {
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" ) ) ;
@ -545,7 +545,7 @@ public class UploadPackTest {
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" ) ) ;
@ -561,7 +561,7 @@ public class UploadPackTest {
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" ) ) ;
@ -574,7 +574,7 @@ public class UploadPackTest {
@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 ( ) ) ;
@ -590,7 +590,7 @@ public class UploadPackTest {
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 ( ) ) ;
@ -608,7 +608,8 @@ public class UploadPackTest {
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" ) ) ;
@ -625,7 +626,8 @@ public class UploadPackTest {
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" ) ) ;
@ -646,8 +648,9 @@ public class UploadPackTest {
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" ) ) ;
@ -675,7 +678,7 @@ public class UploadPackTest {
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" ) ) ;
@ -694,7 +697,7 @@ public class UploadPackTest {
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" ) ) ;
@ -710,7 +713,7 @@ public class UploadPackTest {
"command=ls-refs\n" ,
PacketLineIn . delimiter ( ) ,
"invalid-argument\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -718,7 +721,7 @@ public class UploadPackTest {
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 ) ;
@ -764,7 +767,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + advertized . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
// This doesn't
thrown . expect ( TransportException . class ) ;
@ -777,7 +780,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + unadvertized . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -795,7 +798,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + reachable . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
// This doesn't
thrown . expect ( TransportException . class ) ;
@ -808,7 +811,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + unreachable . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -825,7 +828,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + tip . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
// This doesn't
thrown . expect ( TransportException . class ) ;
@ -838,7 +841,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + parentOfTip . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -856,7 +859,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + parentOfTip . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
// This doesn't
thrown . expect ( TransportException . class ) ;
@ -869,7 +872,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + unreachable . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -884,7 +887,7 @@ public class UploadPackTest {
"command=fetch\n" ,
PacketLineIn . delimiter ( ) ,
"want " + unreachable . name ( ) + "\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -902,7 +905,7 @@ public class UploadPackTest {
"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" ) ) ;
@ -926,7 +929,7 @@ public class UploadPackTest {
"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" ) ) ;
@ -961,7 +964,7 @@ public class UploadPackTest {
"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" ) ) ;
@ -990,7 +993,7 @@ public class UploadPackTest {
"have " + parent . toObjectId ( ) . getName ( ) + "\n" ,
"thin-pack\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
PacketLineIn pckIn = new PacketLineIn ( recvStream ) ;
assertThat ( pckIn . readString ( ) , is ( "packfile" ) ) ;
@ -1014,7 +1017,7 @@ public class UploadPackTest {
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 ) ) ;
@ -1028,7 +1031,7 @@ public class UploadPackTest {
"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 ) ) ;
@ -1048,7 +1051,7 @@ public class UploadPackTest {
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 ) ;
@ -1061,7 +1064,7 @@ public class UploadPackTest {
"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 ) ;
@ -1084,7 +1087,7 @@ public class UploadPackTest {
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 ) ;
@ -1097,7 +1100,7 @@ public class UploadPackTest {
"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 ) ;
@ -1119,7 +1122,7 @@ public class UploadPackTest {
"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 ) ;
@ -1135,7 +1138,7 @@ public class UploadPackTest {
"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 ) ;
@ -1155,7 +1158,7 @@ public class UploadPackTest {
"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 ( ) ) ) ;
@ -1171,7 +1174,7 @@ public class UploadPackTest {
PacketLineIn . delimiter ( ) ,
"want " + child . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
pckIn = new PacketLineIn ( recvStream ) ;
assertThat ( pckIn . readString ( ) , is ( "packfile" ) ) ;
parsePack ( recvStream ) ;
@ -1189,7 +1192,7 @@ public class UploadPackTest {
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"
@ -1224,7 +1227,7 @@ public class UploadPackTest {
"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" ) ) ;
@ -1274,7 +1277,7 @@ public class UploadPackTest {
"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" ) ) ;
@ -1312,7 +1315,7 @@ public class UploadPackTest {
"deepen-since 1510000\n" ,
"want " + tooOld . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -1337,7 +1340,7 @@ public class UploadPackTest {
"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" ) ) ;
@ -1388,7 +1391,7 @@ public class UploadPackTest {
"deepen-not four\n" ,
"want " + two . toObjectId ( ) . getName ( ) + "\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -1408,7 +1411,7 @@ public class UploadPackTest {
"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 ( ) ) ) ;
@ -1443,7 +1446,7 @@ public class UploadPackTest {
"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" ) ) ;
@ -1472,14 +1475,14 @@ public class UploadPackTest {
"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 ) ;
@ -1507,7 +1510,7 @@ public class UploadPackTest {
"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 ) ;
@ -1564,7 +1567,7 @@ public class UploadPackTest {
}
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 ] ) ) ;
@ -1849,7 +1852,7 @@ public class UploadPackTest {
"want " + commit . toObjectId ( ) . getName ( ) + "\n" ,
"filter blob:limit=5\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
}
@Test
@ -1863,7 +1866,7 @@ public class UploadPackTest {
PacketLineIn . delimiter ( ) ,
"want-ref refs/heads/one\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
} catch ( PackProtocolException e ) {
assertThat (
e . getMessage ( ) ,
@ -1890,7 +1893,7 @@ public class UploadPackTest {
"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 (
@ -1921,7 +1924,7 @@ public class UploadPackTest {
"want-ref refs/heads/one\n" ,
"want-ref refs/heads/nonExistentRef\n" ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
} catch ( PackProtocolException e ) {
assertThat (
e . getMessage ( ) ,
@ -1948,7 +1951,7 @@ public class UploadPackTest {
"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 (
@ -1976,7 +1979,7 @@ public class UploadPackTest {
"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
@ -2008,7 +2011,7 @@ public class UploadPackTest {
"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.
@ -2041,7 +2044,7 @@ public class UploadPackTest {
"shallow 0123012301230123012301230123012301230123" ,
"shallow " + two . getName ( ) + '\n' ,
"done\n" ,
PacketLineIn . END ) ;
PacketLineIn . end ( ) ) ;
PacketLineIn pckIn = new PacketLineIn ( recvStream ) ;
assertThat ( pckIn . readString ( ) , is ( "shallow-info" ) ) ;
@ -2070,7 +2073,7 @@ public class UploadPackTest {
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 ( ) ;
@ -2093,7 +2096,7 @@ public class UploadPackTest {
"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 ) ;