Don't use -C in "git diff"
[gitweb.git] / tag.c
diff --git a/tag.c b/tag.c
index 22deb243ad58b2c57fb8652fe2d08c571ee3e781..4041af2572a4427a03bc8955137b7d2211f9d770 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -3,7 +3,7 @@
 
 const char *tag_type = "tag";
 
-struct tag *lookup_tag(unsigned char *sha1)
+struct tag *lookup_tag(const unsigned char *sha1)
 {
         struct object *obj = lookup_object(sha1);
         if (!obj) {
@@ -13,6 +13,8 @@ struct tag *lookup_tag(unsigned char *sha1)
                 ret->object.type = tag_type;
                 return ret;
         }
+       if (!obj->type)
+               obj->type = tag_type;
         if (obj->type != tag_type) {
                 error("Object %s is a %s, not a tree", 
                       sha1_to_hex(sha1), obj->type);