Fix up git-fsck-cache documentation
[gitweb.git] / commit.c
index e83056406f54495fe8a1090a816c425375858d4d..b4e000e9c2cdc726271bdc3ced9c2534848d18de 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -1,8 +1,6 @@
 #include "tag.h"
 #include "commit.h"
 #include "cache.h"
-#include <string.h>
-#include <limits.h>
 
 const char *commit_type = "commit";
 
@@ -37,6 +35,8 @@ struct commit *lookup_commit(unsigned char *sha1)
                ret->object.type = commit_type;
                return ret;
        }
+       if (!obj->type)
+               obj->type = commit_type;
        return check_commit(obj, sha1);
 }