Commit c83c59b8 by Nelson Elhage Committed by Patrick Steinhardt

Remove GIT_PKT_PACK entirely

(cherry picked from commit 90cf8607)
parent 8ced4627
...@@ -35,7 +35,7 @@ enum git_pkt_type { ...@@ -35,7 +35,7 @@ enum git_pkt_type {
GIT_PKT_HAVE, GIT_PKT_HAVE,
GIT_PKT_ACK, GIT_PKT_ACK,
GIT_PKT_NAK, GIT_PKT_NAK,
GIT_PKT_PACK, GIT_PKT_PACK__UNUSED,
GIT_PKT_COMMENT, GIT_PKT_COMMENT,
GIT_PKT_ERR, GIT_PKT_ERR,
GIT_PKT_DATA, GIT_PKT_DATA,
......
...@@ -86,19 +86,6 @@ static int nak_pkt(git_pkt **out) ...@@ -86,19 +86,6 @@ static int nak_pkt(git_pkt **out)
return 0; return 0;
} }
static int pack_pkt(git_pkt **out)
{
git_pkt *pkt;
pkt = git__malloc(sizeof(git_pkt));
GITERR_CHECK_ALLOC(pkt);
pkt->type = GIT_PKT_PACK;
*out = pkt;
return 0;
}
static int comment_pkt(git_pkt **out, const char *line, size_t len) static int comment_pkt(git_pkt **out, const char *line, size_t len)
{ {
git_pkt_comment *pkt; git_pkt_comment *pkt;
...@@ -378,7 +365,7 @@ static int32_t parse_len(const char *line) ...@@ -378,7 +365,7 @@ static int32_t parse_len(const char *line)
num[k] = '.'; num[k] = '.';
} }
} }
giterr_set(GITERR_NET, "invalid hex digit in length: '%s'", num); giterr_set(GITERR_NET, "invalid hex digit in length: '%s'", num);
return -1; return -1;
} }
...@@ -415,17 +402,7 @@ int git_pkt_parse_line( ...@@ -415,17 +402,7 @@ int git_pkt_parse_line(
len = parse_len(line); len = parse_len(line);
if (len < 0) { if (len < 0) {
/* return GIT_ERROR;
* If we fail to parse the length, it might be because the
* server is trying to send us the packfile already.
*/
if (bufflen >= 4 && !git__prefixcmp(line, "PACK")) {
giterr_clear();
*out = line;
return pack_pkt(head);
}
return (int)len;
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment