- if (nr >= MAX_COMMITS || get_sha1_hex(arg, sha1[nr]))
- usage("rev-tree [--edges] [--cache <cache-file>] <commit-id> [<commit-id>]");
- process_commit(sha1[nr]);
+ if (nr >= MAX_COMMITS || get_sha1(arg, sha1[nr]))
+ usage("git-rev-tree [--edges] [--cache <cache-file>] <commit-id> [<commit-id>]");
+
+ commit = lookup_commit_reference(sha1[nr]);
+ if (!commit || parse_commit(commit) < 0)
+ die("bad commit object");
+ commit_list_insert(commit, &list);