|
|
@ -610,19 +610,22 @@ public class PackWriter { |
|
|
|
* stream. |
|
|
|
* stream. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void writePack(OutputStream packStream) throws IOException { |
|
|
|
public void writePack(OutputStream packStream) throws IOException { |
|
|
|
if ((reuseDeltas || reuseObjects) && reuseSupport != null) |
|
|
|
try { |
|
|
|
searchForReuse(); |
|
|
|
if ((reuseDeltas || reuseObjects) && reuseSupport != null) |
|
|
|
|
|
|
|
searchForReuse(); |
|
|
|
out = new PackOutputStream(packStream, isDeltaBaseAsOffset()); |
|
|
|
|
|
|
|
|
|
|
|
out = new PackOutputStream(packStream, isDeltaBaseAsOffset()); |
|
|
|
writeMonitor.beginTask(WRITING_OBJECTS_PROGRESS, getObjectsNumber()); |
|
|
|
|
|
|
|
out.writeFileHeader(PACK_VERSION_GENERATED, getObjectsNumber()); |
|
|
|
int cnt = getObjectsNumber(); |
|
|
|
writeObjects(); |
|
|
|
writeMonitor.beginTask(WRITING_OBJECTS_PROGRESS, cnt); |
|
|
|
writeChecksum(); |
|
|
|
out.writeFileHeader(PACK_VERSION_GENERATED, cnt); |
|
|
|
|
|
|
|
writeObjects(); |
|
|
|
out = null; |
|
|
|
writeChecksum(); |
|
|
|
reader.release(); |
|
|
|
writeMonitor.endTask(); |
|
|
|
writeMonitor.endTask(); |
|
|
|
} finally { |
|
|
|
|
|
|
|
out = null; |
|
|
|
|
|
|
|
reader.release(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void searchForReuse() throws IOException { |
|
|
|
private void searchForReuse() throws IOException { |
|
|
|