make progress "title" part of the common progress interface
[gitweb.git] / mktag.c
diff --git a/mktag.c b/mktag.c
index be23e589fbf504cb165abc3b97bdf5adb7317f68..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;
@@ -119,7 +119,7 @@ static int verify_tag(char *buffer, unsigned long size)
 int main(int argc, char **argv)
 {
        unsigned long size = 4096;
-       char *buffer = malloc(size);
+       char *buffer = xmalloc(size);
        unsigned char result_sha1[20];
 
        if (argc != 1)