Merge branch 'ls/travis-doc-asciidoctor'
[gitweb.git] / cache-tree.c
index f28b1f45a49b842c2f7a372b0c0c595bebc56b5d..34baa6d85a1e156a5d01c0e5f9c5f5d2709049ab 100644 (file)
@@ -168,7 +168,7 @@ static int verify_cache(struct cache_entry **cache,
                                break;
                        }
                        fprintf(stderr, "%s: unmerged (%s)\n",
-                               ce->name, sha1_to_hex(ce->sha1));
+                               ce->name, oid_to_hex(&ce->oid));
                }
        }
        if (funny)
@@ -349,12 +349,14 @@ static int update_one(struct cache_tree *it,
                        }
                }
                else {
-                       sha1 = ce->sha1;
+                       sha1 = ce->oid.hash;
                        mode = ce->ce_mode;
                        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;