From 3d12d0cfbbda0feb6305d6c53f3cf9aae2330c4c Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Mon, 13 Nov 2006 13:50:00 +0000 Subject: Catch errors when writing an index that contains invalid objects. If git-write-index is called without --missing-ok, it reports invalid objects that it finds in the index. But without this patch it dies right away or may run into an infinite loop. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- cache-tree.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cache-tree.c') diff --git a/cache-tree.c b/cache-tree.c index a80326289d..9b73c8669a 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -282,6 +282,8 @@ static int update_one(struct cache_tree *it, baselen + sublen + 1, missing_ok, dryrun); + if (subcnt < 0) + return subcnt; i += subcnt - 1; sub->used = 1; } -- cgit v1.2.3