]> git.ipfire.org Git - thirdparty/git.git/commit - sub-process.c
sub-process: refactor handshake to common function
authorJonathan Tan <jonathantanmy@google.com>
Wed, 26 Jul 2017 18:17:29 +0000 (11:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Jul 2017 20:00:40 +0000 (13:00 -0700)
commitfa64a2fdbeedd98c5f24d1662bcc470a8449abcf
tree7da566f387a1f3253d7ecc98a48495d311881988
parent7e2e1bbb24a5a0868fc83f1eddf804574f9e4b54
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>
convert.c
pkt-line.c
pkt-line.h
sub-process.c
sub-process.h
t/t0021-conversion.sh