aboutsummaryrefslogtreecommitdiffstats
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-08-18 20:04:04 +0000
committerJunio C Hamano <gitster@pobox.com>2019-08-19 15:04:57 -0700
commitf6af19a9ad814de530bfac9b564126234434a9e3 (patch)
treed76bb52ebeed3767f83588217ca2d72a0f41b768 /fetch-pack.c
parent36261e42ec30477434f3325f279fd91a1d9eb434 (diff)
downloadgit-f6af19a9ad814de530bfac9b564126234434a9e3.tar.gz
fetch-pack: use parse_oid_hex
Instead of hard-coding constants, use parse_oid_hex to compute a pointer and use it in further parsing operations. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 65be043f2a..1f56b8a6d7 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -168,16 +168,16 @@ static enum ack_type get_ack(struct packet_reader *reader,
if (!strcmp(reader->line, "NAK"))
return NAK;
if (skip_prefix(reader->line, "ACK ", &arg)) {
- if (!get_oid_hex(arg, result_oid)) {
- arg += 40;
- len -= arg - reader->line;
+ const char *p;
+ if (!parse_oid_hex(arg, result_oid, &p)) {
+ len -= p - reader->line;
if (len < 1)
return ACK;
- if (strstr(arg, "continue"))
+ if (strstr(p, "continue"))
return ACK_continue;
- if (strstr(arg, "common"))
+ if (strstr(p, "common"))
return ACK_common;
- if (strstr(arg, "ready"))
+ if (strstr(p, "ready"))
return ACK_ready;
return ACK;
}