summaryrefslogtreecommitdiff
path: root/src/clone.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-10-15 07:06:22 +0200
committernulltoken <emeric.fermas@gmail.com>2012-10-15 20:40:37 +0200
commitc4f68b3202f017dc3a52aec3c0e56b3b908923d2 (patch)
treea90e7deba0b3105996457e1aeea1ee6276c876f9 /src/clone.c
parent4d968f134b8ccd20e5a5b26ee160372076c55f5c (diff)
downloadlibgit2-c4f68b3202f017dc3a52aec3c0e56b3b908923d2.tar.gz
clone: fix detection of remote HEAD
Diffstat (limited to 'src/clone.c')
-rw-r--r--src/clone.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clone.c b/src/clone.c
index 71931664c..82042a46a 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -18,6 +18,7 @@
#include "common.h"
#include "remote.h"
+#include "pkt.h"
#include "fileops.h"
#include "refs.h"
#include "path.h"
@@ -174,6 +175,7 @@ static int update_head_to_remote(git_repository *repo, git_remote *remote)
{
int retcode = -1;
git_remote_head *remote_head;
+ git_pkt_ref *pkt;
struct head_info head_info;
git_buf remote_master_name = GIT_BUF_INIT;
@@ -187,7 +189,8 @@ static int update_head_to_remote(git_repository *repo, git_remote *remote)
}
/* Get the remote's HEAD. This is always the first ref in remote->refs. */
- remote_head = remote->refs.contents[0];
+ pkt = remote->transport->refs.contents[0];
+ remote_head = &pkt->head;
git_oid_cpy(&head_info.remote_head_oid, &remote_head->oid);
git_buf_init(&head_info.branchname, 16);
head_info.repo = repo;