Merge branch 'bc/object-id'
[gitweb.git] / cache-tree.c
index 48924102123b019f3f6d69f7f07047a3d4a68d50..ec23d8c03d10bd3815f59c2d70ae5eb45170aaad 100644 (file)
@@ -354,7 +354,9 @@ static int update_one(struct cache_tree *it,
                        entlen = pathlen - baselen;
                        i++;
                }
-               if (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1)) {
+
+               if (is_null_sha1(sha1) ||
+                   (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1))) {
                        strbuf_release(&buffer);
                        if (expected_missing)
                                return -1;