| 475 | } |
| 476 | |
| 477 | static struct commit *check_single_commit(struct rev_info *revs) |
| 478 | { |
| 479 | struct object *commit = NULL; |
| 480 | int found = -1; |
| 481 | int i; |
| 482 | |
| 483 | for (i = 0; i < revs->pending.nr; i++) { |
| 484 | struct object *obj = revs->pending.objects[i].item; |
| 485 | if (obj->flags & UNINTERESTING) |
| 486 | continue; |
| 487 | obj = deref_tag(revs->repo, obj, NULL, 0); |
| 488 | if (!obj || obj->type != OBJ_COMMIT) |
| 489 | die("Non commit %s?", revs->pending.objects[i].name); |
| 490 | if (commit) |
| 491 | die("More than one commit to dig from: %s and %s?", |
| 492 | revs->pending.objects[i].name, |
| 493 | revs->pending.objects[found].name); |
| 494 | commit = obj; |
| 495 | found = i; |
| 496 | } |
| 497 | |
| 498 | if (!commit) |
| 499 | die("No commit specified?"); |
| 500 | |
| 501 | return (struct commit *) commit; |
| 502 | } |
| 503 | |
| 504 | static void fill_blob_sha1(struct repository *r, struct commit *commit, |
| 505 | struct diff_filespec *spec) |
no test coverage detected