X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=cache-tree.c;h=c60cf9140dd18254886ea14de763738630f95973;hb=d3fd3d1f9bbb454864bd004dc3f29f99e4087889;hp=d91743775dfbe98d99d8ab25a270af320c8b984e;hpb=1c92a08f286453bd28a1f6153249b2e2cf63cb38;p=git.git diff --git a/cache-tree.c b/cache-tree.c index d91743775..c60cf9140 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -328,9 +328,11 @@ static int update_one(struct cache_tree *it, mode = ce->ce_mode; entlen = pathlen - baselen; } - if (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1)) + if (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1)) { + strbuf_release(&buffer); return error("invalid object %06o %s for '%.*s'", mode, sha1_to_hex(sha1), entlen+baselen, path); + } if (ce->ce_flags & CE_REMOVE) continue; /* entry being removed */