summaryrefslogtreecommitdiff
path: root/send-pack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-03-07 13:36:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-07 22:54:14 (GMT)
commitf7cd74d19d3e2a194760024046534adf20f9efde (patch)
tree4c3c60da5cb67dcd3ada8cb3b0957969a9b88c45 /send-pack.c
parent7c39df2979733e0041db7aff09c3f3a53b980ef2 (diff)
downloadgit-f7cd74d19d3e2a194760024046534adf20f9efde.zip
git-f7cd74d19d3e2a194760024046534adf20f9efde.tar.gz
git-f7cd74d19d3e2a194760024046534adf20f9efde.tar.bz2
send-pack: use skip_prefix for parsing unpack status
This avoids repeating ourselves, and the use of magic numbers. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/send-pack.c b/send-pack.c
index 12e229e..243633d 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -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;
}