handle_revision_arg: simplify commit reference lookups
[gitweb.git] / revision.c
index 2bcd60a2bb06bb46e451a4b0b94b3213e892b551..dc3281290669c07e70c8c2909023d6fc1686e6fe 100644 (file)
@@ -1500,12 +1500,8 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi
                                struct commit *a, *b;
                                struct commit_list *exclude;
 
-                               a = (a_obj->type == OBJ_COMMIT
-                                    ? (struct commit *)a_obj
-                                    : lookup_commit_reference(a_obj->oid.hash));
-                               b = (b_obj->type == OBJ_COMMIT
-                                    ? (struct commit *)b_obj
-                                    : lookup_commit_reference(b_obj->oid.hash));
+                               a = lookup_commit_reference(a_obj->oid.hash);
+                               b = lookup_commit_reference(b_obj->oid.hash);
                                if (!a || !b)
                                        goto missing;
                                exclude = get_merge_bases(a, b);