From: Nguyễn Thái Ngọc Duy Date: Tue, 30 Apr 2013 03:42:50 GMT Subject: [PATCH v2 6/8] cache-tree.c: refuse to write trees referring to external objects Message-ID: <1367293372-1958-7-git-send-email-pclouds@gmail.com> In-Reply-To: <1367293372-1958-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- cache-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cache-tree.c b/cache-tree.c index 37e4d00..478da88 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -343,7 +343,8 @@ static int update_one(struct cache_tree *it, entlen = pathlen - baselen; i++; } - if (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1)) { + if (mode != S_IFGITLINK && !missing_ok && + !has_sha1_file_proper(sha1)) { strbuf_release(&buffer); return error("invalid object %06o %s for '%.*s'", mode, sha1_to_hex(sha1), entlen+baselen, path); -- 1.8.2.83.gc99314b