Skip to content

Commit 81ed96a

Browse files
jonathantanmygitster
authored andcommitted
fetch-pack: buffer object-format with other args
In send_fetch_request(), "object-format" is written directly to the file descriptor, as opposed to the other arguments, which are buffered. Buffer "object-format" as well. "object-format" must be buffered; in particular, it must appear after "command=fetch" in the request. This divergence was introduced in 4b83120 ("fetch-pack: parse and advertise the object-format capability", 2020-05-27), perhaps as an oversight (the surrounding code at the point of this commit has already been using a request buffer.) Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e4f4299 commit 81ed96a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fetch-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ static int send_fetch_request(struct fetch_negotiator *negotiator, int fd_out,
12101210
if (hash_algo_by_ptr(the_hash_algo) != hash_algo)
12111211
die(_("mismatched algorithms: client %s; server %s"),
12121212
the_hash_algo->name, hash_name);
1213-
packet_write_fmt(fd_out, "object-format=%s", the_hash_algo->name);
1213+
packet_buf_write(&req_buf, "object-format=%s", the_hash_algo->name);
12141214
} else if (hash_algo_by_ptr(the_hash_algo) != GIT_HASH_SHA1) {
12151215
die(_("the server does not support algorithm '%s'"),
12161216
the_hash_algo->name);

0 commit comments

Comments
 (0)