upload-pack: fix thinko in common-commit finder code.
[gitweb.git] / upload-pack.c
index c3abf7ba659b9f4957740486b8bb7aca5b1c8471..25a343eccb5a0757c26caecdb471852d0ebac8d2 100644 (file)
@@ -93,7 +93,9 @@ static int got_sha1(char *hex, unsigned char *sha1)
                return 0;
        if (nr_has < MAX_HAS) {
                struct object *o = lookup_object(sha1);
-               if (!o || (!o->parsed && !parse_object(sha1)))
+               if (!(o && o->parsed))
+                       o = parse_object(sha1);
+               if (!o)
                        die("oops (%s)", sha1_to_hex(sha1));
                if (o->type == commit_type) {
                        struct commit_list *parents;