Thread (11 messages) flat view 11 messages, 2 authors, 2017-03-08
STALE3456d

[PATCH 3/6] send-pack: use skip_prefix for parsing unpack status

From: Jeff King <hidden>
Date: 2017-03-07 18:36:04
Subsystem: the rest · Maintainer: Linus Torvalds

This avoids repeating ourselves, and the use of magic
numbers.

Signed-off-by: Jeff King <redacted>
---
Obviously not necessary, but just a cleanup while I was here.

 send-pack.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/send-pack.c b/send-pack.c
index 12e229e44..243633da1 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;
 }
 
-- 
2.12.0.429.gde83c8049
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help