summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4728b86)
raw | patch | inline | side by side (parent: 4728b86)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sun, 24 Apr 2005 21:17:13 +0000 (14:17 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sun, 24 Apr 2005 21:17:13 +0000 (14:17 -0700) |
Otherwise we can have objects without a type, which is not good.
commit.c | patch | blob | history | |
tree.c | patch | blob | history |
diff --git a/commit.c b/commit.c
index 2502688262819033f5b8ed60a7bef5eed0aa2d6a..c0dd689ea3be3ef8d161cac056350e61851e7f64 100644 (file)
--- a/commit.c
+++ b/commit.c
struct commit *ret = malloc(sizeof(struct commit));
memset(ret, 0, sizeof(struct commit));
created_object(sha1, &ret->object);
+ ret->object.type = commit_type;
return ret;
}
if (obj->parsed && obj->type != commit_type) {
if (strcmp(type, commit_type))
return error("Object %s not a commit",
sha1_to_hex(item->object.sha1));
- item->object.type = commit_type;
get_sha1_hex(bufptr + 5, parent);
item->tree = lookup_tree(parent);
add_ref(&item->object, &item->tree->object);
index 79b9625855c017ce0298f62cc398ed4d16964cb1..23476da7deb4eaa98a7f872eed4981b274904af7 100644 (file)
--- a/tree.c
+++ b/tree.c
struct tree *ret = malloc(sizeof(struct tree));
memset(ret, 0, sizeof(struct tree));
created_object(sha1, &ret->object);
+ ret->object.type = tree_type;
return ret;
}
if (obj->parsed && obj->type != tree_type) {
if (item->object.parsed)
return 0;
item->object.parsed = 1;
- item->object.type = tree_type;
buffer = bufptr = read_sha1_file(item->object.sha1, type, &size);
if (!buffer)
return error("Could not read %s",