if (!obj->type)
obj->type = OBJ_TAG;
if (obj->type != OBJ_TAG) {
- error("Object %s is a %s, not a tree",
+ error("Object %s is a %s, not a tag",
sha1_to_hex(sha1), typename(obj->type));
return NULL;
}
memcpy(type, type_line + 5, typelen);
type[typelen] = '\0';
taglen = sig_line - tag_line - strlen("tag \n");
- item->tag = xmalloc(taglen + 1);
- memcpy(item->tag, tag_line + 4, taglen);
- item->tag[taglen] = '\0';
+ item->tag = xmemdupz(tag_line + 4, taglen);
if (!strcmp(type, blob_type)) {
item->tagged = &lookup_blob(sha1)->object;