@ -181,7 +181,7 @@ public class PackWriter {
private final ObjectIdSubclassMap < ObjectToPack > objectsMap = new ObjectIdSubclassMap < ObjectToPack > ( ) ;
private final ObjectIdSubclassMap < ObjectToPack > objectsMap = new ObjectIdSubclassMap < ObjectToPack > ( ) ;
// edge objects for thin packs
// edge objects for thin packs
private final ObjectIdSubclassMap < ObjectId > edgeObjects = new ObjectIdSubclassMap < ObjectId > ( ) ;
private final ObjectIdSubclassMap < ObjectToPack > edgeObjects = new ObjectIdSubclassMap < ObjectToPack > ( ) ;
private int compressionLevel ;
private int compressionLevel ;
@ -813,11 +813,11 @@ public class PackWriter {
RevObject o ;
RevObject o ;
while ( ( o = walker . next ( ) ) ! = null ) {
while ( ( o = walker . next ( ) ) ! = null ) {
addObject ( o ) ;
addObject ( o , 0 ) ;
countingMonitor . update ( 1 ) ;
countingMonitor . update ( 1 ) ;
}
}
while ( ( o = walker . nextObject ( ) ) ! = null ) {
while ( ( o = walker . nextObject ( ) ) ! = null ) {
addObject ( o ) ;
addObject ( o , walker . getPathHashCode ( ) ) ;
countingMonitor . update ( 1 ) ;
countingMonitor . update ( 1 ) ;
}
}
countingMonitor . endTask ( ) ;
countingMonitor . endTask ( ) ;
@ -837,9 +837,21 @@ public class PackWriter {
* /
* /
public void addObject ( final RevObject object )
public void addObject ( final RevObject object )
throws IncorrectObjectTypeException {
throws IncorrectObjectTypeException {
addObject ( object , 0 ) ;
}
private void addObject ( final RevObject object , final int pathHashCode )
throws IncorrectObjectTypeException {
if ( object . has ( RevFlag . UNINTERESTING ) ) {
if ( object . has ( RevFlag . UNINTERESTING ) ) {
edgeObjects . add ( object ) ;
switch ( object . getType ( ) ) {
thin = true ;
case Constants . OBJ_TREE :
case Constants . OBJ_BLOB :
ObjectToPack otp = new ObjectToPack ( object ) ;
otp . setPathHash ( pathHashCode ) ;
edgeObjects . add ( otp ) ;
thin = true ;
break ;
}
return ;
return ;
}
}
@ -848,6 +860,8 @@ public class PackWriter {
otp = reuseSupport . newObjectToPack ( object ) ;
otp = reuseSupport . newObjectToPack ( object ) ;
else
else
otp = new ObjectToPack ( object ) ;
otp = new ObjectToPack ( object ) ;
otp . setPathHash ( pathHashCode ) ;
try {
try {
objectsLists [ object . getType ( ) ] . add ( otp ) ;
objectsLists [ object . getType ( ) ] . add ( otp ) ;
} catch ( ArrayIndexOutOfBoundsException x ) {
} catch ( ArrayIndexOutOfBoundsException x ) {