builtin-fsck: move away from object-refs to fsck_walk
[gitweb.git] / upload-pack.c
index 7e04311027176fc87c1de7dd619000d2a75d4eb9..d1d2c2a1f77a53417e7bebcd71bffe5b1588f8f3 100644 (file)
@@ -533,7 +533,8 @@ static void receive_needs(void)
                                /* make sure the real parents are parsed */
                                unregister_shallow(object->sha1);
                                object->parsed = 0;
-                               parse_commit((struct commit *)object);
+                               if (parse_commit((struct commit *)object))
+                                       die("invalid commit");
                                parents = ((struct commit *)object)->parents;
                                while (parents) {
                                        add_object_array(&parents->item->object,
@@ -620,6 +621,9 @@ int main(int argc, char **argv)
 
        if (i != argc-1)
                usage(upload_pack_usage);
+
+       setup_path(NULL);
+
        dir = argv[i];
 
        if (!enter_repo(dir, strict))