|
|
@ -714,26 +714,27 @@ public class GC { |
|
|
|
JGitText.get().cannotCreateIndexfile, tmpIdx.getPath())); |
|
|
|
JGitText.get().cannotCreateIndexfile, tmpIdx.getPath())); |
|
|
|
|
|
|
|
|
|
|
|
// write the packfile
|
|
|
|
// write the packfile
|
|
|
|
@SuppressWarnings("resource" /* java 7 */) |
|
|
|
FileOutputStream fos = new FileOutputStream(tmpPack); |
|
|
|
FileChannel channel = new FileOutputStream(tmpPack).getChannel(); |
|
|
|
FileChannel channel = fos.getChannel(); |
|
|
|
OutputStream channelStream = Channels.newOutputStream(channel); |
|
|
|
OutputStream channelStream = Channels.newOutputStream(channel); |
|
|
|
try { |
|
|
|
try { |
|
|
|
pw.writePack(pm, pm, channelStream); |
|
|
|
pw.writePack(pm, pm, channelStream); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
channel.force(true); |
|
|
|
channel.force(true); |
|
|
|
channelStream.close(); |
|
|
|
channelStream.close(); |
|
|
|
channel.close(); |
|
|
|
fos.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// write the packindex
|
|
|
|
// write the packindex
|
|
|
|
FileChannel idxChannel = new FileOutputStream(tmpIdx).getChannel(); |
|
|
|
fos = new FileOutputStream(tmpIdx); |
|
|
|
|
|
|
|
FileChannel idxChannel = fos.getChannel(); |
|
|
|
OutputStream idxStream = Channels.newOutputStream(idxChannel); |
|
|
|
OutputStream idxStream = Channels.newOutputStream(idxChannel); |
|
|
|
try { |
|
|
|
try { |
|
|
|
pw.writeIndex(idxStream); |
|
|
|
pw.writeIndex(idxStream); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
idxChannel.force(true); |
|
|
|
idxChannel.force(true); |
|
|
|
idxStream.close(); |
|
|
|
idxStream.close(); |
|
|
|
idxChannel.close(); |
|
|
|
fos.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (pw.prepareBitmapIndex(pm)) { |
|
|
|
if (pw.prepareBitmapIndex(pm)) { |
|
|
@ -745,14 +746,15 @@ public class GC { |
|
|
|
JGitText.get().cannotCreateIndexfile, |
|
|
|
JGitText.get().cannotCreateIndexfile, |
|
|
|
tmpBitmapIdx.getPath())); |
|
|
|
tmpBitmapIdx.getPath())); |
|
|
|
|
|
|
|
|
|
|
|
idxChannel = new FileOutputStream(tmpBitmapIdx).getChannel(); |
|
|
|
fos = new FileOutputStream(tmpBitmapIdx); |
|
|
|
|
|
|
|
idxChannel = fos.getChannel(); |
|
|
|
idxStream = Channels.newOutputStream(idxChannel); |
|
|
|
idxStream = Channels.newOutputStream(idxChannel); |
|
|
|
try { |
|
|
|
try { |
|
|
|
pw.writeBitmapIndex(idxStream); |
|
|
|
pw.writeBitmapIndex(idxStream); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
idxChannel.force(true); |
|
|
|
idxChannel.force(true); |
|
|
|
idxStream.close(); |
|
|
|
idxStream.close(); |
|
|
|
idxChannel.close(); |
|
|
|
fos.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|