builtin/blame.c: struct blame_entry does not need a prev link
[gitweb.git] / builtin / show-ref.c
index 18680bbaeb80b4b5119e5a3b73eae8181fcac439..5ba1f3083890c693f8ce82166fe1cb1f6440b106 100644 (file)
@@ -37,8 +37,8 @@ static int show_ref(const char *refname, const unsigned char *sha1, int flag, vo
        if (tags_only || heads_only) {
                int match;
 
-               match = heads_only && !prefixcmp(refname, "refs/heads/");
-               match |= tags_only && !prefixcmp(refname, "refs/tags/");
+               match = heads_only && starts_with(refname, "refs/heads/");
+               match |= tags_only && starts_with(refname, "refs/tags/");
                if (!match)
                        return 0;
        }
@@ -165,15 +165,15 @@ static int help_callback(const struct option *opt, const char *arg, int unset)
 }
 
 static const struct option show_ref_options[] = {
-       OPT_BOOLEAN(0, "tags", &tags_only, N_("only show tags (can be combined with heads)")),
-       OPT_BOOLEAN(0, "heads", &heads_only, N_("only show heads (can be combined with tags)")),
-       OPT_BOOLEAN(0, "verify", &verify, N_("stricter reference checking, "
+       OPT_BOOL(0, "tags", &tags_only, N_("only show tags (can be combined with heads)")),
+       OPT_BOOL(0, "heads", &heads_only, N_("only show heads (can be combined with tags)")),
+       OPT_BOOL(0, "verify", &verify, N_("stricter reference checking, "
                    "requires exact ref path")),
        OPT_HIDDEN_BOOL('h', NULL, &show_head,
                        N_("show the HEAD reference, even if it would be filtered out")),
-       OPT_BOOLEAN(0, "head", &show_head,
+       OPT_BOOL(0, "head", &show_head,
          N_("show the HEAD reference, even if it would be filtered out")),
-       OPT_BOOLEAN('d', "dereference", &deref_tags,
+       OPT_BOOL('d', "dereference", &deref_tags,
                    N_("dereference tags into object IDs")),
        { OPTION_CALLBACK, 's', "hash", &abbrev, N_("n"),
          N_("only show SHA1 hash using <n> digits"),
@@ -210,7 +210,7 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)
                while (*pattern) {
                        unsigned char sha1[20];
 
-                       if (!prefixcmp(*pattern, "refs/") &&
+                       if (starts_with(*pattern, "refs/") &&
                            !read_ref(*pattern, sha1)) {
                                if (!quiet)
                                        show_one(*pattern, sha1);