summaryrefslogtreecommitdiff
path: root/src/pkt.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-11-28 08:40:40 +0100
committerVicent Marti <tanoku@gmail.com>2011-11-28 08:40:40 +0100
commitd88d4311c7e08ad0d38edae006b50e2a548c937d (patch)
tree1b26cee0c3d383043902c599893299fd8fdc5302 /src/pkt.c
parentc94785a9f373b6604402ba6a301b828b80ab8cd8 (diff)
downloadlibgit2-repo-ownership.tar.gz
remote: Cleanup the remotes coderepo-ownership
- Hide the remaining transports code - Drop `git_headarray`, switch to using a callback to list refs. Makes the code cleaner.
Diffstat (limited to 'src/pkt.c')
-rw-r--r--src/pkt.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/pkt.c b/src/pkt.c
index ff8c56eb2..9dfc40255 100644
--- a/src/pkt.c
+++ b/src/pkt.c
@@ -316,30 +316,30 @@ static int send_want_with_caps(git_remote_head *head, git_transport_caps *caps,
* is overwrite the OID each time.
*/
-int git_pkt_buffer_wants(git_headarray *refs, git_transport_caps *caps, git_buf *buf)
+int git_pkt_buffer_wants(const git_vector *refs, git_transport_caps *caps, git_buf *buf)
{
unsigned int i = 0;
int error;
git_remote_head *head;
if (caps->common) {
- for (; i < refs->len; ++i) {
- head = refs->heads[i];
+ for (; i < refs->length; ++i) {
+ head = refs->contents[i];
if (!head->local)
break;
}
- error = buffer_want_with_caps(refs->heads[i], caps, buf);
+ error = buffer_want_with_caps(refs->contents[i], caps, buf);
if (error < GIT_SUCCESS)
return git__rethrow(error, "Failed to buffer want with caps");
i++;
}
- for (; i < refs->len; ++i) {
+ for (; i < refs->length; ++i) {
char oid[GIT_OID_HEXSZ];
- head = refs->heads[i];
+ head = refs->contents[i];
if (head->local)
continue;
@@ -352,7 +352,7 @@ int git_pkt_buffer_wants(git_headarray *refs, git_transport_caps *caps, git_buf
return git_pkt_buffer_flush(buf);
}
-int git_pkt_send_wants(git_headarray *refs, git_transport_caps *caps, int fd)
+int git_pkt_send_wants(const git_vector *refs, git_transport_caps *caps, int fd)
{
unsigned int i = 0;
int error = GIT_SUCCESS;
@@ -365,15 +365,15 @@ int git_pkt_send_wants(git_headarray *refs, git_transport_caps *caps, int fd)
/* If there are common caps, find the first one */
if (caps->common) {
- for (; i < refs->len; ++i) {
- head = refs->heads[i];
+ for (; i < refs->length; ++i) {
+ head = refs->contents[i];
if (head->local)
continue;
else
break;
}
- error = send_want_with_caps(refs->heads[i], caps, fd);
+ error = send_want_with_caps(refs->contents[i], caps, fd);
if (error < GIT_SUCCESS)
return git__rethrow(error, "Failed to send want pkt with caps");
/* Increase it here so it's correct whether we run this or not */
@@ -381,8 +381,8 @@ int git_pkt_send_wants(git_headarray *refs, git_transport_caps *caps, int fd)
}
/* Continue from where we left off */
- for (; i < refs->len; ++i) {
- head = refs->heads[i];
+ for (; i < refs->length; ++i) {
+ head = refs->contents[i];
if (head->local)
continue;