|
|
@ -365,13 +365,11 @@ public class ArchiveCommand extends GitCommand<OutputStream> { |
|
|
|
|
|
|
|
|
|
|
|
private <T extends Closeable> OutputStream writeArchive(Format<T> fmt) { |
|
|
|
private <T extends Closeable> OutputStream writeArchive(Format<T> fmt) { |
|
|
|
final String pfx = prefix == null ? "" : prefix; //$NON-NLS-1$
|
|
|
|
final String pfx = prefix == null ? "" : prefix; //$NON-NLS-1$
|
|
|
|
final TreeWalk walk = new TreeWalk(repo); |
|
|
|
try (final TreeWalk walk = new TreeWalk(repo)) { |
|
|
|
try { |
|
|
|
|
|
|
|
final T outa = fmt.createArchiveOutputStream(out, formatOptions); |
|
|
|
final T outa = fmt.createArchiveOutputStream(out, formatOptions); |
|
|
|
try { |
|
|
|
try (final RevWalk rw = new RevWalk(walk.getObjectReader())) { |
|
|
|
final MutableObjectId idBuf = new MutableObjectId(); |
|
|
|
final MutableObjectId idBuf = new MutableObjectId(); |
|
|
|
final ObjectReader reader = walk.getObjectReader(); |
|
|
|
final ObjectReader reader = walk.getObjectReader(); |
|
|
|
final RevWalk rw = new RevWalk(walk.getObjectReader()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
walk.reset(rw.parseTree(tree)); |
|
|
|
walk.reset(rw.parseTree(tree)); |
|
|
|
if (!paths.isEmpty()) |
|
|
|
if (!paths.isEmpty()) |
|
|
@ -405,8 +403,6 @@ public class ArchiveCommand extends GitCommand<OutputStream> { |
|
|
|
// TODO(jrn): Throw finer-grained errors.
|
|
|
|
// TODO(jrn): Throw finer-grained errors.
|
|
|
|
throw new JGitInternalException( |
|
|
|
throw new JGitInternalException( |
|
|
|
JGitText.get().exceptionCaughtDuringExecutionOfArchiveCommand, e); |
|
|
|
JGitText.get().exceptionCaughtDuringExecutionOfArchiveCommand, e); |
|
|
|
} finally { |
|
|
|
|
|
|
|
walk.release(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|