Can I use ArchiveCommand to implement the command 'git archive -- remote=origin -- output=archive. zip' on my git server? The client keeps reporting this error 'fatal: protocol error: bad line length character: PK??'. How can this be resolved, or is it not supported at all。 this code is:
writePacketLine(getOutputStream(), "ACK");
writeFlush(getOutputStream());
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
new ArchiveCommand(repo)
.setFormat("zip")
.setTree(treeId)
.setOutputStream(buffer)
.call();
getOutputStream().write(buffer.toByteArray());
getOutputStream().flush();
writeFlush(getOutputStream());