refs: convert resolve_ref_unsafe to struct object_id
[gitweb.git] / builtin / tag.c
index 43c07ddeb3a8b44a67db41b05cc2ac51c4c5885e..8c458b96137c62f55dcf1b6bebe71cd35221deaf 100644 (file)
@@ -82,7 +82,7 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn,
        for (p = argv; *p; p++) {
                strbuf_reset(&ref);
                strbuf_addf(&ref, "refs/tags/%s", *p);
-               if (read_ref(ref.buf, oid.hash)) {
+               if (read_ref(ref.buf, &oid)) {
                        error(_("tag '%s' not found."), *p);
                        had_error = 1;
                        continue;
@@ -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 (read_ref(ref.buf, prev.hash))
+       if (read_ref(ref.buf, &prev))
                oidclr(&prev);
        else if (!force)
                die(_("tag '%s' already exists"), tag);