@ -172,6 +172,8 @@ public class PackWriter {
* /
* /
public static final int DEFAULT_DELTA_SEARCH_WINDOW_SIZE = 10 ;
public static final int DEFAULT_DELTA_SEARCH_WINDOW_SIZE = 10 ;
static final long DEFAULT_BIG_FILE_THRESHOLD = 50 * 1024 * 1024 ;
private static final int PACK_VERSION_GENERATED = 2 ;
private static final int PACK_VERSION_GENERATED = 2 ;
@SuppressWarnings ( "unchecked" )
@SuppressWarnings ( "unchecked" )
@ -216,6 +218,8 @@ public class PackWriter {
private int indexVersion ;
private int indexVersion ;
private long bigFileThreshold = DEFAULT_BIG_FILE_THRESHOLD ;
private boolean thin ;
private boolean thin ;
private boolean ignoreMissingUninteresting = true ;
private boolean ignoreMissingUninteresting = true ;
@ -269,6 +273,7 @@ public class PackWriter {
maxDeltaDepth = pc . deltaDepth ;
maxDeltaDepth = pc . deltaDepth ;
compressionLevel = pc . compression ;
compressionLevel = pc . compression ;
indexVersion = pc . indexVersion ;
indexVersion = pc . indexVersion ;
bigFileThreshold = pc . bigFileThreshold ;
}
}
private static Config configOf ( final Repository repo ) {
private static Config configOf ( final Repository repo ) {
@ -455,6 +460,29 @@ public class PackWriter {
deltaSearchWindowSize = objectCount ;
deltaSearchWindowSize = objectCount ;
}
}
/ * *
* Get the maximum file size that will be delta compressed .
* < p >
* Files bigger than this setting will not be delta compressed , as they are
* more than likely already highly compressed binary data files that do not
* delta compress well , such as MPEG videos .
*
* @return the configured big file threshold .
* /
public long getBigFileThreshold ( ) {
return bigFileThreshold ;
}
/ * *
* Set the maximum file size that should be considered for deltas .
*
* @param bigFileThreshold
* the limit , in bytes .
* /
public void setBigFileThreshold ( long bigFileThreshold ) {
this . bigFileThreshold = bigFileThreshold ;
}
/** @return true if this writer is producing a thin pack. */
/** @return true if this writer is producing a thin pack. */
public boolean isThin ( ) {
public boolean isThin ( ) {
return thin ;
return thin ;