Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2006-11-13 16:50:00 +0300
committerJunio C Hamano <junkio@cox.net>2006-11-14 01:26:51 +0300
commit3d12d0cfbbda0feb6305d6c53f3cf9aae2330c4c (patch)
tree9456a5b78dc2991f7158e8e1c536aa0db1a7d8df /cache-tree.c
parent40cf043389ef4cdf3e56e7c4268d6f302e387fa0 (diff)
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>
Diffstat (limited to 'cache-tree.c')
-rw-r--r--cache-tree.c2
1 files changed, 2 insertions, 0 deletions
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;
}