diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2017-07-26 20:17:29 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-26 22:00:40 +0200 |
commit | fa64a2fdbeedd98c5f24d1662bcc470a8449abcf (patch) | |
tree | 7da566f387a1f3253d7ecc98a48495d311881988 /pkt-line.c | |
parent | Documentation: migrate sub-process docs to header (diff) | |
download | git-fa64a2fdbeedd98c5f24d1662bcc470a8449abcf.tar.xz git-fa64a2fdbeedd98c5f24d1662bcc470a8449abcf.zip |
sub-process: refactor handshake to common function
Refactor, into a common function, the version and capability negotiation
done when invoking a long-running process as a clean or smudge filter.
This will be useful for other Git code that needs to interact similarly
with a long-running process.
As you can see in the change to t0021, this commit changes the error
message reported when the long-running process does not introduce itself
with the expected "server"-terminated line. Originally, the error
message reports that the filter "does not support filter protocol
version 2", differentiating between the old single-file filter protocol
and the new multi-file filter protocol - I have updated it to something
more generic and useful.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pkt-line.c')
-rw-r--r-- | pkt-line.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/pkt-line.c b/pkt-line.c index 9d845ecc3c..7db9119573 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -171,25 +171,6 @@ int packet_write_fmt_gently(int fd, const char *fmt, ...) return status; } -int packet_writel(int fd, const char *line, ...) -{ - va_list args; - int err; - va_start(args, line); - for (;;) { - if (!line) - break; - if (strlen(line) > LARGE_PACKET_DATA_MAX) - return -1; - err = packet_write_fmt_gently(fd, "%s\n", line); - if (err) - return err; - line = va_arg(args, const char*); - } - va_end(args); - return packet_flush_gently(fd); -} - static int packet_write_gently(const int fd_out, const char *buf, size_t size) { static char packet_write_buffer[LARGE_PACKET_MAX]; |