Convert many resolve_ref() calls to read_ref*() and ref_exists()
[gitweb.git] / builtin / tag.c
index 9d89616863f4b9102706c726c51e36acddef8997..439249d466ccb9d3e4d78764b8b4b8c44536a7b5 100644 (file)
@@ -174,7 +174,7 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn)
                        had_error = 1;
                        continue;
                }
-               if (!resolve_ref(ref, sha1, 1, NULL)) {
+               if (read_ref(ref, sha1)) {
                        error(_("tag '%s' not found."), *p);
                        had_error = 1;
                        continue;
@@ -407,12 +407,12 @@ static int parse_msg_arg(const struct option *opt, const char *arg, int unset)
 static int strbuf_check_tag_ref(struct strbuf *sb, const char *name)
 {
        if (name[0] == '-')
-               return CHECK_REF_FORMAT_ERROR;
+               return -1;
 
        strbuf_reset(sb);
        strbuf_addf(sb, "refs/tags/%s", name);
 
-       return check_ref_format(sb->buf);
+       return check_refname_format(sb->buf, 0);
 }
 
 int cmd_tag(int argc, const char **argv, const char *prefix)
@@ -518,7 +518,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
        if (strbuf_check_tag_ref(&ref, tag))
                die(_("'%s' is not a valid tag name."), tag);
 
-       if (!resolve_ref(ref.buf, prev, 1, NULL))
+       if (read_ref(ref.buf, prev))
                hashclr(prev);
        else if (!force)
                die(_("tag '%s' already exists"), tag);