builtin-fetch--tool: adjust to updated sha1_object_info().
[gitweb.git] / commit.c
index 8d279b0b635f58482b5a45c6a8a0086744b0735d..da515a49738c3c8e3065da08e468a93bf976f1e4 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -342,18 +342,18 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
 
 int parse_commit(struct commit *item)
 {
-       char type[20];
+       enum object_type type;
        void *buffer;
        unsigned long size;
        int ret;
 
        if (item->object.parsed)
                return 0;
-       buffer = read_sha1_file(item->object.sha1, type, &size);
+       buffer = read_sha1_file(item->object.sha1, &type, &size);
        if (!buffer)
                return error("Could not read %s",
                             sha1_to_hex(item->object.sha1));
-       if (strcmp(type, commit_type)) {
+       if (type != OBJ_COMMIT) {
                free(buffer);
                return error("Object %s not a commit",
                             sha1_to_hex(item->object.sha1));