Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
send-pack: use skip_prefix for parsing unpack status
author
Jeff King
<peff@peff.net>
Tue, 7 Mar 2017 13:36:19 +0000
(08:36 -0500)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 7 Mar 2017 22:54:14 +0000
(14:54 -0800)
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>
send-pack.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
7c39df2
)
diff --git
a/send-pack.c
b/send-pack.c
index 12e229e4476f7efe268070e543a2ccd8de9ab7e8..243633da17784cdb14ae056b0b9015f9e439d76c 100644
(file)
--- 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 (!s
tarts_with(line, "unpack "
))
+ if (!s
kip_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;
}