From: Junio C Hamano Date: Fri, 13 Mar 2009 04:44:48 +0000 (-0700) Subject: Merge branch 'jc/maint-1.6.1-allow-uninteresting-missing' into maint-1.6.1 X-Git-Tag: v1.6.2.1~1^2~8 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/daf713dd497ef04855ccecf90ad9aafb17769681?ds=inline;hp=-c Merge branch 'jc/maint-1.6.1-allow-uninteresting-missing' into maint-1.6.1 * jc/maint-1.6.1-allow-uninteresting-missing: revision traversal: allow UNINTERESTING objects to be missing --- daf713dd497ef04855ccecf90ad9aafb17769681 diff --combined revision.c index c0df714f6c,1663ac80ea..286e416b75 --- a/revision.c +++ b/revision.c @@@ -183,8 -183,11 +183,11 @@@ static struct commit *handle_commit(str if (!tag->tagged) die("bad tag"); object = parse_object(tag->tagged->sha1); - if (!object) + if (!object) { + if (flags & UNINTERESTING) + return NULL; die("bad object %s", sha1_to_hex(tag->tagged->sha1)); + } } /* @@@ -479,9 -482,10 +482,10 @@@ static int add_parents_to_list(struct r while (parent) { struct commit *p = parent->item; parent = parent->next; + if (p) + p->object.flags |= UNINTERESTING; if (parse_commit(p) < 0) - return -1; - p->object.flags |= UNINTERESTING; + continue; if (p->parents) mark_parents_uninteresting(p); if (p->object.flags & SEEN) @@@ -1263,7 -1267,6 +1267,7 @@@ int setup_revisions(int argc, const cha if (!strcmp(arg, "--all")) { handle_refs(revs, flags, for_each_ref); + handle_refs(revs, flags, head_ref); continue; } if (!strcmp(arg, "--branches")) { @@@ -1734,16 -1737,14 +1738,16 @@@ static struct commit *get_revision_1(st (commit->date < revs->max_age)) continue; if (add_parents_to_list(revs, commit, &revs->commits, NULL) < 0) - return NULL; + die("Failed to traverse parents of commit %s", + sha1_to_hex(commit->object.sha1)); } switch (simplify_commit(revs, commit)) { case commit_ignore: continue; case commit_error: - return NULL; + die("Failed to simplify parents of commit %s", + sha1_to_hex(commit->object.sha1)); default: return commit; }