]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/update-ref.c
object-name.h: move declarations for object-name.c functions from cache.h
[thirdparty/git.git] / builtin / update-ref.c
index a84e7b47a20620b421b9ab3782cdad4e52bc9e90..6ca85420c3b82f0eb92321679540d0c3a2fa1802 100644 (file)
@@ -1,7 +1,9 @@
 #include "cache.h"
 #include "config.h"
+#include "gettext.h"
 #include "refs.h"
 #include "builtin.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "quote.h"
 #include "strvec.h"
@@ -116,7 +118,7 @@ static int parse_next_oid(const char **next, const char *end,
                (*next)++;
                *next = parse_arg(*next, &arg);
                if (arg.len) {
-                       if (get_oid(arg.buf, oid))
+                       if (repo_get_oid(the_repository, arg.buf, oid))
                                goto invalid;
                } else {
                        /* Without -z, an empty value means all zeros: */
@@ -134,7 +136,7 @@ static int parse_next_oid(const char **next, const char *end,
                *next += arg.len;
 
                if (arg.len) {
-                       if (get_oid(arg.buf, oid))
+                       if (repo_get_oid(the_repository, arg.buf, oid))
                                goto invalid;
                } else if (flags & PARSE_SHA1_ALLOW_EMPTY) {
                        /* With -z, treat an empty value as all zeros: */
@@ -549,7 +551,7 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
                refname = argv[0];
                value = argv[1];
                oldval = argv[2];
-               if (get_oid(value, &oid))
+               if (repo_get_oid(the_repository, value, &oid))
                        die("%s: not a valid SHA1", value);
        }
 
@@ -560,7 +562,7 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
                         * must not already exist:
                         */
                        oidclr(&oldoid);
-               else if (get_oid(oldval, &oldoid))
+               else if (repo_get_oid(the_repository, oldval, &oldoid))
                        die("%s: not a valid old SHA1", oldval);
        }