summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-02-20 20:06:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-02-24 08:17:38 (GMT)
commit85edf4f58b5368e2f2acc4bce0d10e1ca9d6c879 (patch)
tree8aebba6d7b9df301e6e9144eaf98ebda021424be /connect.c
parent4981fe750b1fc58bfdf5b9ca9843f4f505b9bb4d (diff)
downloadgit-85edf4f58b5368e2f2acc4bce0d10e1ca9d6c879.zip
git-85edf4f58b5368e2f2acc4bce0d10e1ca9d6c879.tar.gz
git-85edf4f58b5368e2f2acc4bce0d10e1ca9d6c879.tar.bz2
teach get_remote_heads to read from a memory buffer
Now that we can read packet data from memory as easily as a descriptor, get_remote_heads can take either one as a source. This will allow further refactoring in remote-curl. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/connect.c b/connect.c
index 3d99999..f57efd0 100644
--- a/connect.c
+++ b/connect.c
@@ -62,8 +62,8 @@ static void die_initial_contact(int got_at_least_one_head)
/*
* Read all the refs from the other end
*/
-struct ref **get_remote_heads(int in, struct ref **list,
- unsigned int flags,
+struct ref **get_remote_heads(int in, char *src_buf, size_t src_len,
+ struct ref **list, unsigned int flags,
struct extra_have_objects *extra_have)
{
int got_at_least_one_head = 0;
@@ -76,7 +76,7 @@ struct ref **get_remote_heads(int in, struct ref **list,
int len, name_len;
char *buffer = packet_buffer;
- len = packet_read(in, NULL, NULL,
+ len = packet_read(in, &src_buf, &src_len,
packet_buffer, sizeof(packet_buffer),
PACKET_READ_GENTLE_ON_EOF |
PACKET_READ_CHOMP_NEWLINE);