aboutsummaryrefslogtreecommitdiffstats
path: root/transport-helper.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-03-20 05:34:17 -0400
committerJunio C Hamano <gitster@pobox.com>2024-03-20 10:00:55 -0700
commitcf7335f5b6e93a45a07fabe9360582322b607eec (patch)
tree67cd245b5e784e57d3d1067f6cc4ac0f160648f0 /transport-helper.c
parente09f1254c54329773904fe25d7c545a1fb4fa920 (diff)
downloadgit-cf7335f5b6e93a45a07fabe9360582322b607eec.tar.gz
transport-helper: use write helpers more consistently
The transport-helper code provides some functions for writing to the helper process, but there are a few spots that don't use them. We should do so consistently because: 1. They detect errors on write (though in practice this means the helper process went away, and we'd see the problem as soon as we try to read the response). 2. They dump the written bytes to the GIT_TRANSPORT_HELPER_DEBUG stream. It's doubly confusing to miss some writes but not others, as you see a partial conversation. The "list" ones go all the way back to the beginning of the transport helper code; they were just missed when most writes were converted in bf3c523c3f (Add remote helper debug mode, 2009-12-09). The nearby "object-format" write presumably just cargo-culted them, as it's only a few lines away. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/transport-helper.c b/transport-helper.c
index dd6002b393..dde537190f 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -1211,15 +1211,15 @@ static struct ref *get_refs_list_using_list(struct transport *transport,
helper = get_helper(transport);
if (data->object_format) {
- write_str_in_full(helper->in, "option object-format\n");
+ write_constant(helper->in, "option object-format\n");
if (recvline(data, &buf) || strcmp(buf.buf, "ok"))
exit(128);
}
if (data->push && for_push)
- write_str_in_full(helper->in, "list for-push\n");
+ write_constant(helper->in, "list for-push\n");
else
- write_str_in_full(helper->in, "list\n");
+ write_constant(helper->in, "list\n");
while (1) {
char *eov, *eon;