Merge branches 'jc/rev-list' and 'jc/pack-thin'
[git.git] / upload-pack.c
index 3cdf428..635abb3 100644 (file)
@@ -221,6 +221,9 @@ static int send_ref(const char *refname, const unsigned char *sha1)
        static char *capabilities = "multi_ack thin-pack";
        struct object *o = parse_object(sha1);
 
+       if (!o)
+               die("git-upload-pack: cannot find object %s:", sha1_to_hex(sha1));
+
        if (capabilities)
                packet_write(1, "%s %s%c%s\n", sha1_to_hex(sha1), refname,
                        0, capabilities);