Sync with 1.7.6.2
[gitweb.git] / builtin / fetch-pack.c
index cb5b20ae08e4e30a009146339ec790ef742bf783..412bd327b5b396c159c768b25be189e00531c38e 100644 (file)
@@ -425,6 +425,8 @@ static int find_common(int fd[2], unsigned char *result_sha1,
                                case ACK_continue: {
                                        struct commit *commit =
                                                lookup_commit(result_sha1);
+                                       if (!commit)
+                                               die("invalid commit %s", sha1_to_hex(result_sha1));
                                        if (args.stateless_rpc
                                         && ack == ACK_common
                                         && !(commit->object.flags & COMMON)) {