Merge branch 'rs/maint-config-use-labs' into maint
[gitweb.git] / tag.c
diff --git a/tag.c b/tag.c
index 7b07921b30641994ab3a877b6b377c5ce1f40149..5b0ac62ed846188ad44ceac41d278ff37ec8bd9d 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -4,9 +4,6 @@
 #include "tree.h"
 #include "blob.h"
 
-#define PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----"
-#define PGP_MESSAGE "-----BEGIN PGP MESSAGE-----"
-
 const char *tag_type = "tag";
 
 struct object *deref_tag(struct object *o, const char *warn, int warnlen)
@@ -40,15 +37,8 @@ struct tag *lookup_tag(const unsigned char *sha1)
 {
        struct object *obj = lookup_object(sha1);
        if (!obj)
-               return create_object(sha1, OBJ_TAG, alloc_tag_node());
-       if (!obj->type)
-               obj->type = OBJ_TAG;
-       if (obj->type != OBJ_TAG) {
-               error("Object %s is a %s, not a tag",
-                     sha1_to_hex(sha1), typename(obj->type));
-               return NULL;
-       }
-       return (struct tag *) obj;
+               return create_object(sha1, alloc_tag_node());
+       return object_as_type(obj, OBJ_TAG, 0);
 }
 
 static unsigned long parse_tag_date(const char *buf, const char *tail)
@@ -150,20 +140,3 @@ int parse_tag(struct tag *item)
        free(data);
        return ret;
 }
-
-/*
- * Look at a signed tag object, and return the offset where
- * the embedded detached signature begins, or the end of the
- * data when there is no such signature.
- */
-size_t parse_signature(const char *buf, unsigned long size)
-{
-       char *eol;
-       size_t len = 0;
-       while (len < size && !starts_with(buf + len, PGP_SIGNATURE) &&
-                       !starts_with(buf + len, PGP_MESSAGE)) {
-               eol = memchr(buf + len, '\n', size - len);
-               len += eol ? eol - (buf + len) + 1 : size - len;
-       }
-       return len;
-}