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 <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
40cf043389
commit
3d12d0cfbb
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user