@ -255,7 +255,7 @@ public abstract class BaseReceivePack {
walk = new RevWalk ( db ) ;
walk = new RevWalk ( db ) ;
final ReceiveConfig cfg = db . getConfig ( ) . get ( ReceiveConfig . KEY ) ;
final ReceiveConfig cfg = db . getConfig ( ) . get ( ReceiveConfig . KEY ) ;
objectChecker = cfg . checkReceivedObjects ? new ObjectChecker ( ) : null ;
objectChecker = cfg . newObjectChecker ( ) ;
allowCreates = cfg . allowCreates ;
allowCreates = cfg . allowCreates ;
allowDeletes = cfg . allowDeletes ;
allowDeletes = cfg . allowDeletes ;
allowNonFastForwards = cfg . allowNonFastForwards ;
allowNonFastForwards = cfg . allowNonFastForwards ;
@ -274,19 +274,26 @@ public abstract class BaseReceivePack {
} ;
} ;
final boolean checkReceivedObjects ;
final boolean checkReceivedObjects ;
final boolean allowLeadingZeroFileMode ;
final boolean safeForWindows ;
final boolean safeForMacOS ;
final boolean allowCreates ;
final boolean allowCreates ;
final boolean allowDeletes ;
final boolean allowDeletes ;
final boolean allowNonFastForwards ;
final boolean allowNonFastForwards ;
final boolean allowOfsDelta ;
final boolean allowOfsDelta ;
ReceiveConfig ( final Config config ) {
ReceiveConfig ( final Config config ) {
checkReceivedObjects = config . getBoolean (
checkReceivedObjects = config . getBoolean (
"receive" , "fsckobjects" , //$NON-NLS-1$ //$NON-NLS-2$
"receive" , "fsckobjects" , //$NON-NLS-1$ //$NON-NLS-2$
config . getBoolean ( "transfer" , "fsckobjects" , false ) ) ; //$NON-NLS-1$ //$NON-NLS-2$
config . getBoolean ( "transfer" , "fsckobjects" , false ) ) ; //$NON-NLS-1$ //$NON-NLS-2$
allowLeadingZeroFileMode = checkReceivedObjects
& & config . getBoolean ( "fsck" , "allowLeadingZeroFileMode" , false ) ; //$NON-NLS-1$ //$NON-NLS-2$
safeForWindows = checkReceivedObjects
& & config . getBoolean ( "fsck" , "safeForWindows" , false ) ; //$NON-NLS-1$ //$NON-NLS-2$
safeForMacOS = checkReceivedObjects
& & config . getBoolean ( "fsck" , "safeForMacOS" , false ) ; //$NON-NLS-1$ //$NON-NLS-2$
allowCreates = true ;
allowCreates = true ;
allowDeletes = ! config . getBoolean ( "receive" , "denydeletes" , false ) ; //$NON-NLS-1$ //$NON-NLS-2$
allowDeletes = ! config . getBoolean ( "receive" , "denydeletes" , false ) ; //$NON-NLS-1$ //$NON-NLS-2$
allowNonFastForwards = ! config . getBoolean ( "receive" , //$NON-NLS-1$
allowNonFastForwards = ! config . getBoolean ( "receive" , //$NON-NLS-1$
@ -294,6 +301,15 @@ public abstract class BaseReceivePack {
allowOfsDelta = config . getBoolean ( "repack" , "usedeltabaseoffset" , //$NON-NLS-1$ //$NON-NLS-2$
allowOfsDelta = config . getBoolean ( "repack" , "usedeltabaseoffset" , //$NON-NLS-1$ //$NON-NLS-2$
true ) ;
true ) ;
}
}
ObjectChecker newObjectChecker ( ) {
if ( ! checkReceivedObjects )
return null ;
return new ObjectChecker ( )
. setAllowLeadingZeroFileMode ( allowLeadingZeroFileMode )
. setSafeForWindows ( safeForWindows )
. setSafeForMacOS ( safeForMacOS ) ;
}
}
}
/ * *
/ * *