|
|
@ -1189,27 +1189,21 @@ public class GC { |
|
|
|
JGitText.get().cannotCreateIndexfile, tmpIdx.getPath())); |
|
|
|
JGitText.get().cannotCreateIndexfile, tmpIdx.getPath())); |
|
|
|
|
|
|
|
|
|
|
|
// write the packfile
|
|
|
|
// write the packfile
|
|
|
|
FileOutputStream fos = new FileOutputStream(tmpPack); |
|
|
|
try (FileOutputStream fos = new FileOutputStream(tmpPack); |
|
|
|
FileChannel channel = fos.getChannel(); |
|
|
|
FileChannel channel = fos.getChannel(); |
|
|
|
OutputStream channelStream = Channels.newOutputStream(channel); |
|
|
|
OutputStream channelStream = Channels |
|
|
|
try { |
|
|
|
.newOutputStream(channel)) { |
|
|
|
pw.writePack(pm, pm, channelStream); |
|
|
|
pw.writePack(pm, pm, channelStream); |
|
|
|
} finally { |
|
|
|
|
|
|
|
channel.force(true); |
|
|
|
channel.force(true); |
|
|
|
channelStream.close(); |
|
|
|
|
|
|
|
fos.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// write the packindex
|
|
|
|
// write the packindex
|
|
|
|
fos = new FileOutputStream(tmpIdx); |
|
|
|
try (FileOutputStream fos = new FileOutputStream(tmpIdx); |
|
|
|
FileChannel idxChannel = fos.getChannel(); |
|
|
|
FileChannel idxChannel = fos.getChannel(); |
|
|
|
OutputStream idxStream = Channels.newOutputStream(idxChannel); |
|
|
|
OutputStream idxStream = Channels |
|
|
|
try { |
|
|
|
.newOutputStream(idxChannel)) { |
|
|
|
pw.writeIndex(idxStream); |
|
|
|
pw.writeIndex(idxStream); |
|
|
|
} finally { |
|
|
|
|
|
|
|
idxChannel.force(true); |
|
|
|
idxChannel.force(true); |
|
|
|
idxStream.close(); |
|
|
|
|
|
|
|
fos.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (pw.prepareBitmapIndex(pm)) { |
|
|
|
if (pw.prepareBitmapIndex(pm)) { |
|
|
@ -1221,15 +1215,12 @@ public class GC { |
|
|
|
JGitText.get().cannotCreateIndexfile, |
|
|
|
JGitText.get().cannotCreateIndexfile, |
|
|
|
tmpBitmapIdx.getPath())); |
|
|
|
tmpBitmapIdx.getPath())); |
|
|
|
|
|
|
|
|
|
|
|
fos = new FileOutputStream(tmpBitmapIdx); |
|
|
|
try (FileOutputStream fos = new FileOutputStream(tmpBitmapIdx); |
|
|
|
idxChannel = fos.getChannel(); |
|
|
|
FileChannel idxChannel = fos.getChannel(); |
|
|
|
idxStream = Channels.newOutputStream(idxChannel); |
|
|
|
OutputStream idxStream = Channels |
|
|
|
try { |
|
|
|
.newOutputStream(idxChannel)) { |
|
|
|
pw.writeBitmapIndex(idxStream); |
|
|
|
pw.writeBitmapIndex(idxStream); |
|
|
|
} finally { |
|
|
|
|
|
|
|
idxChannel.force(true); |
|
|
|
idxChannel.force(true); |
|
|
|
idxStream.close(); |
|
|
|
|
|
|
|
fos.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|