diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-21 01:20:40 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-21 01:20:41 +0300 |
commit | c2509c5407a70a187664982c7f484e7daacafc4f (patch) | |
tree | a2adf6f287353d2db2c9d6c58c35813e63fcff3a /ls-refs.c | |
parent | ed8794ef7ae9f345ab88c6f1ee728e06fc7b8ce4 (diff) | |
parent | 70afef5cdf29b5159f18df1b93722055f78740f8 (diff) |
Merge branch 'jv/pkt-line-batch'
Reduce number of write(2) system calls while sending the
ref advertisement.
* jv/pkt-line-batch:
upload-pack: use stdio in send_ref callbacks
pkt-line: add stdio packet write functions
Diffstat (limited to 'ls-refs.c')
-rw-r--r-- | ls-refs.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -107,7 +107,7 @@ static int send_ref(const char *refname, const struct object_id *oid, } strbuf_addch(&data->buf, '\n'); - packet_write(1, data->buf.buf, data->buf.len); + packet_fwrite(stdout, data->buf.buf, data->buf.len); return 0; } @@ -173,7 +173,7 @@ int ls_refs(struct repository *r, struct strvec *keys, strvec_push(&data.prefixes, ""); for_each_fullref_in_prefixes(get_git_namespace(), data.prefixes.v, send_ref, &data, 0); - packet_flush(1); + packet_fflush(stdout); strvec_clear(&data.prefixes); strbuf_release(&data.buf); return 0; |