diff options
author | Jeff King <peff@peff.net> | 2017-03-07 08:36:19 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-07 14:54:14 -0800 |
commit | f7cd74d19d3e2a194760024046534adf20f9efde (patch) | |
tree | 4c3c60da5cb67dcd3ada8cb3b0957969a9b88c45 /send-pack.c | |
parent | 7c39df2979733e0041db7aff09c3f3a53b980ef2 (diff) | |
download | git-f7cd74d19d3e2a194760024046534adf20f9efde.tar.gz |
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/send-pack.c b/send-pack.c index 12e229e447..243633da17 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; } |