check return value from parse_commit() in various functions
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
9786f68bfc
commit
dec38c8165
3
commit.c
3
commit.c
|
@ -387,8 +387,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
|
||||||
|
|
||||||
while (parents) {
|
while (parents) {
|
||||||
struct commit *commit = parents->item;
|
struct commit *commit = parents->item;
|
||||||
parse_commit(commit);
|
if (!parse_commit(commit) && !(commit->object.flags & mark)) {
|
||||||
if (!(commit->object.flags & mark)) {
|
|
||||||
commit->object.flags |= mark;
|
commit->object.flags |= mark;
|
||||||
insert_by_date(commit, list);
|
insert_by_date(commit, list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,8 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
|
||||||
cur_depth = *(int *)commit->util;
|
cur_depth = *(int *)commit->util;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
parse_commit(commit);
|
if (parse_commit(commit))
|
||||||
|
die("invalid commit");
|
||||||
commit->object.flags |= not_shallow_flag;
|
commit->object.flags |= not_shallow_flag;
|
||||||
cur_depth++;
|
cur_depth++;
|
||||||
for (p = commit->parents, commit = NULL; p; p = p->next) {
|
for (p = commit->parents, commit = NULL; p; p = p->next) {
|
||||||
|
|
|
@ -533,7 +533,8 @@ static void receive_needs(void)
|
||||||
/* make sure the real parents are parsed */
|
/* make sure the real parents are parsed */
|
||||||
unregister_shallow(object->sha1);
|
unregister_shallow(object->sha1);
|
||||||
object->parsed = 0;
|
object->parsed = 0;
|
||||||
parse_commit((struct commit *)object);
|
if (parse_commit((struct commit *)object))
|
||||||
|
die("invalid commit");
|
||||||
parents = ((struct commit *)object)->parents;
|
parents = ((struct commit *)object)->parents;
|
||||||
while (parents) {
|
while (parents) {
|
||||||
add_object_array(&parents->item->object,
|
add_object_array(&parents->item->object,
|
||||||
|
|
Loading…
Reference in New Issue