From: Junio C Hamano Date: Mon, 24 Apr 2006 22:12:42 +0000 (-0700) Subject: cache-tree: protect against "git prune". X-Git-Tag: v1.4.0-rc1~45^2~21 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/dd0c34c46bdda0c20fd92d00516e711a4c9f7837?hp=dd0c34c46bdda0c20fd92d00516e711a4c9f7837 cache-tree: protect against "git prune". We reused the cache-tree data without verifying the tree object still exists. Recompute in cache_tree_update() an otherwise valid cache-tree entry when the tree object disappeared. This is not usually a problem, but theoretically without this fix things can break when the user does something like this: - read-index from a side branch - write-tree the result - remove the side branch with "git branch -D" - remove the unreachable objects with "git prune" - write-tree what is in the index. Signed-off-by: Junio C Hamano ---