@ -45,6 +45,7 @@ import org.eclipse.jgit.revwalk.RevBlob;
import org.eclipse.jgit.revwalk.RevCommit ;
import org.eclipse.jgit.revwalk.RevCommit ;
import org.eclipse.jgit.revwalk.RevTag ;
import org.eclipse.jgit.revwalk.RevTag ;
import org.eclipse.jgit.revwalk.RevTree ;
import org.eclipse.jgit.revwalk.RevTree ;
import org.eclipse.jgit.storage.pack.PackStatistics ;
import org.eclipse.jgit.transport.UploadPack.RequestPolicy ;
import org.eclipse.jgit.transport.UploadPack.RequestPolicy ;
import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException ;
import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException ;
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException ;
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException ;
@ -76,6 +77,8 @@ public class UploadPackTest {
private TestRepository < InMemoryRepository > remote ;
private TestRepository < InMemoryRepository > remote ;
private PackStatistics stats ;
@Before
@Before
public void setUp ( ) throws Exception {
public void setUp ( ) throws Exception {
server = newRepo ( "server" ) ;
server = newRepo ( "server" ) ;
@ -460,6 +463,7 @@ public class UploadPackTest {
ByteArrayOutputStream recv = new ByteArrayOutputStream ( ) ;
ByteArrayOutputStream recv = new ByteArrayOutputStream ( ) ;
up . upload ( send , recv , null ) ;
up . upload ( send , recv , null ) ;
stats = up . getStatistics ( ) ;
return new ByteArrayInputStream ( recv . toByteArray ( ) ) ;
return new ByteArrayInputStream ( recv . toByteArray ( ) ) ;
}
}
@ -1630,6 +1634,7 @@ public class UploadPackTest {
. has ( preparator . blobLowDepth . toObjectId ( ) ) ) ;
. has ( preparator . blobLowDepth . toObjectId ( ) ) ) ;
assertFalse ( client . getObjectDatabase ( )
assertFalse ( client . getObjectDatabase ( )
. has ( preparator . blobHighDepth . toObjectId ( ) ) ) ;
. has ( preparator . blobHighDepth . toObjectId ( ) ) ) ;
assertEquals ( 1 , stats . getTreesTraversed ( ) ) ;
}
}
@Test
@Test
@ -1651,6 +1656,7 @@ public class UploadPackTest {
. has ( preparator . blobLowDepth . toObjectId ( ) ) ) ;
. has ( preparator . blobLowDepth . toObjectId ( ) ) ) ;
assertFalse ( client . getObjectDatabase ( )
assertFalse ( client . getObjectDatabase ( )
. has ( preparator . blobHighDepth . toObjectId ( ) ) ) ;
. has ( preparator . blobHighDepth . toObjectId ( ) ) ) ;
assertEquals ( 1 , stats . getTreesTraversed ( ) ) ;
}
}
@Test
@Test
@ -1668,6 +1674,7 @@ public class UploadPackTest {
. has ( preparator . blobLowDepth . toObjectId ( ) ) ) ;
. has ( preparator . blobLowDepth . toObjectId ( ) ) ) ;
assertFalse ( client . getObjectDatabase ( )
assertFalse ( client . getObjectDatabase ( )
. has ( preparator . blobHighDepth . toObjectId ( ) ) ) ;
. has ( preparator . blobHighDepth . toObjectId ( ) ) ) ;
assertEquals ( 2 , stats . getTreesTraversed ( ) ) ;
}
}
/ * *
/ * *