@ -710,11 +710,32 @@ public class PackWriter implements AutoCloseable {
public void preparePack ( ProgressMonitor countingMonitor ,
public void preparePack ( ProgressMonitor countingMonitor ,
@NonNull Set < ? extends ObjectId > want ,
@NonNull Set < ? extends ObjectId > want ,
@NonNull Set < ? extends ObjectId > have ) throws IOException {
@NonNull Set < ? extends ObjectId > have ) throws IOException {
preparePack ( countingMonitor ,
want , have , Collections . < ObjectId > emptySet ( ) ) ;
}
/ * *
* Prepare the list of objects to be written to the pack stream .
* < p >
* Like { @link # preparePack ( ProgressMonitor , Set , Set ) } but also allows
* specifying commits that should not be walked past ( "shallow" commits ) .
* The caller is responsible for filtering out commits that should not
* be shallow any more ( "unshallow" commits as in { @link # setShallowPack } )
* from the shallow set .
*
* @since 4 . 5
* /
public void preparePack ( ProgressMonitor countingMonitor ,
@NonNull Set < ? extends ObjectId > want ,
@NonNull Set < ? extends ObjectId > have ,
@NonNull Set < ? extends ObjectId > shallow ) throws IOException {
ObjectWalk ow ;
ObjectWalk ow ;
if ( shallowPack )
if ( shallowPack ) {
ow = new DepthWalk . ObjectWalk ( reader , depth - 1 ) ;
ow = new DepthWalk . ObjectWalk ( reader , depth - 1 ) ;
else
} else {
ow = new ObjectWalk ( reader ) ;
ow = new ObjectWalk ( reader ) ;
}
ow . assumeShallow ( shallow ) ;
preparePack ( countingMonitor , ow , want , have ) ;
preparePack ( countingMonitor , ow , want , have ) ;
}
}