Code

convert object type handling from a string to a number
[git.git] / mktag.c
diff --git a/mktag.c b/mktag.c
index 3448a5dde7cbd795b08db872180f03dcfb66b99a..931011121e7276513b55fc41691c65a0d924119d 100644 (file)
--- a/mktag.c
+++ b/mktag.c
 static int verify_object(unsigned char *sha1, const char *expected_type)
 {
        int ret = -1;
-       char type[100];
+       enum object_type type;
        unsigned long size;
-       void *buffer = read_sha1_file(sha1, type, &size);
+       void *buffer = read_sha1_file(sha1, &type, &size);
 
        if (buffer) {
-               if (!strcmp(type, expected_type))
-                       ret = check_sha1_signature(sha1, buffer, size, type);
+               if (type == type_from_string(expected_type))
+                       ret = check_sha1_signature(sha1, buffer, size, expected_type);
                free(buffer);
        }
        return ret;