提交 f7cd74d1 编写于 作者: J Jeff King 提交者: Junio C Hamano

send-pack: use skip_prefix for parsing unpack status

This avoids repeating ourselves, and the use of magic
numbers.
Signed-off-by: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 7c39df29
......@@ -133,10 +133,10 @@ static int pack_objects(int fd, struct ref *refs, struct sha1_array *extra, stru
static int receive_unpack_status(int in)
{
const char *line = packet_read_line(in, NULL);
if (!starts_with(line, "unpack "))
if (!skip_prefix(line, "unpack ", &line))
return error("did not receive remote status");
if (strcmp(line, "unpack ok"))
return error("unpack failed: %s", line + 7);
if (strcmp(line, "ok"))
return error("unpack failed: %s", line);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册