X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=connect.c;h=8a8a13bb72b33f335a5a10642f0461ef673ef168;hb=d81bf827192f0af6b1cca64d2cdbaac9b5ca2020;hp=78448889da3f11fa28aacad17d3044a1c0df7e54;hpb=ea44949605781d1947ba1422ee541867e7ce9b81;p=git.git diff --git a/connect.c b/connect.c index 78448889d..8a8a13bb7 100644 --- a/connect.c +++ b/connect.c @@ -96,7 +96,7 @@ int get_ack(int fd, unsigned char *result_sha1) line[--len] = 0; if (!strcmp(line, "NAK")) return 0; - if (!strncmp(line, "ACK ", 4)) { + if (!prefixcmp(line, "ACK ")) { if (!get_sha1_hex(line+4, result_sha1)) { if (strstr(line+45, "continue")) return 2; @@ -196,8 +196,8 @@ static int count_refspec_match(const char *pattern, */ if (namelen != patlen && patlen != namelen - 5 && - strncmp(name, "refs/heads/", 11) && - strncmp(name, "refs/tags/", 10)) { + prefixcmp(name, "refs/heads/") && + prefixcmp(name, "refs/tags/")) { /* We want to catch the case where only weak * matches are found and there are multiple * matches, and where more than one strong