summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2012-10-10 23:55:03 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2012-10-10 23:59:16 +0200
commitaeba5e175a58eebc5eae43adaa40955d2a9f55c3 (patch)
treeb0d1ad5a70abced39a4a1784d1fedebc122fa954
parent8ea05f3f8f3485d39ce4a867b353f45c4eebf54e (diff)
downloadlibgit2-aeba5e175a58eebc5eae43adaa40955d2a9f55c3.tar.gz
http: don't discard the HEAD ref
The fix for fetching from empty repositories (22935b06d protocol: don't store flushes; 2012-10-07) forgot to take into account the deletion of the flush pkt in the HTTP transport. As a result, the HEAD ref advertisement where we detect the remote's capabilities was deleted instead. Fix this.
-rw-r--r--src/transports/http.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/transports/http.c b/src/transports/http.c
index d5015f5af..7b77c925c 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -473,10 +473,7 @@ static int http_connect(git_transport *transport, int direction)
giterr_set(GITERR_NET, "Invalid HTTP response");
return t->error = -1;
} else {
- /* Remove the comment and flush pkts */
- git_vector_remove(&transport->refs, 0);
- git__free(pkt);
- pkt = git_vector_get(&transport->refs, 0);
+ /* Remove the comment pkt from the list */
git_vector_remove(&transport->refs, 0);
git__free(pkt);
}