X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-describe.c;h=165917e40db78e7105a16d6e7a1653862a29fdc5;hb=95655d79ad13697e0d68e986d3b0b402efad007a;hp=bcc645622a962166d19ea811af185ae4d68bd011;hpb=76db9dec8132d4377f6c32e4d45eb75fa0cc7a9a;p=git.git diff --git a/builtin-describe.c b/builtin-describe.c index bcc645622..165917e40 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -52,7 +52,7 @@ static int get_name(const char *path, const unsigned char *sha1, int flag, void * If --tags, then any tags are used. * Otherwise only annotated tags are used. */ - if (!strncmp(path, "refs/tags/", 10)) { + if (!prefixcmp(path, "refs/tags/")) { if (object->type == OBJ_TAG) prio = 2; else @@ -254,12 +254,12 @@ int cmd_describe(int argc, const char **argv, const char *prefix) all = 1; else if (!strcmp(arg, "--tags")) tags = 1; - else if (!strncmp(arg, "--abbrev=", 9)) { + else if (!prefixcmp(arg, "--abbrev=")) { abbrev = strtoul(arg + 9, NULL, 10); if (abbrev != 0 && (abbrev < MINIMUM_ABBREV || 40 < abbrev)) abbrev = DEFAULT_ABBREV; } - else if (!strncmp(arg, "--candidates=", 13)) { + else if (!prefixcmp(arg, "--candidates=")) { max_candidates = strtoul(arg + 13, NULL, 10); if (max_candidates < 1) max_candidates = 1;