fast-import: add tests for tagging blobs
[gitweb.git] / fast-import.c
index 78d978684da2e2b79340c138e1b6300100df1221..ca21458612a68c26b610a31ca009259c05cd08e1 100644 (file)
@@ -2688,13 +2688,9 @@ static void parse_new_tag(void)
                type = oe->type;
                hashcpy(sha1, oe->idx.sha1);
        } else if (!get_sha1(from, sha1)) {
-               unsigned long size;
-               char *buf;
-
-               buf = read_sha1_file(sha1, &type, &size);
-               if (!buf || size < 46)
-                       die("Not a valid commit: %s", from);
-               free(buf);
+               type = sha1_object_info(sha1, NULL);
+               if (type < 0)
+                       die("Not a valid object: %s", from);
        } else
                die("Invalid ref name or SHA1 expression: %s", from);
        read_next_command();