Skip to content

Commit cf7335f

Browse files
peffgitster
authored andcommitted
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 bf3c523 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e09f125 commit cf7335f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

transport-helper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,15 +1211,15 @@ static struct ref *get_refs_list_using_list(struct transport *transport,
12111211
helper = get_helper(transport);
12121212

12131213
if (data->object_format) {
1214-
write_str_in_full(helper->in, "option object-format\n");
1214+
write_constant(helper->in, "option object-format\n");
12151215
if (recvline(data, &buf) || strcmp(buf.buf, "ok"))
12161216
exit(128);
12171217
}
12181218

12191219
if (data->push && for_push)
1220-
write_str_in_full(helper->in, "list for-push\n");
1220+
write_constant(helper->in, "list for-push\n");
12211221
else
1222-
write_str_in_full(helper->in, "list\n");
1222+
write_constant(helper->in, "list\n");
12231223

12241224
while (1) {
12251225
char *eov, *eon;

0 commit comments

Comments
 (0)