From: Johannes Schindelin Date: Sun, 7 May 2006 15:42:37 +0000 (+0200) Subject: Fix crash when reading the empty tree X-Git-Tag: v1.4.0-rc1~45^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b6c4a480b3161effaa3578df91d8cdc83044d7b6;p=git.git Fix crash when reading the empty tree cvsimport needs to call git-read-tree without arguments to create an empty tree. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/read-tree.c b/read-tree.c index 067fb95e9..49436bf96 100644 --- a/read-tree.c +++ b/read-tree.c @@ -881,8 +881,8 @@ int main(int argc, char **argv) * valid cache-tree because the index must match exactly * what came from the tree. */ - if (trees->item && (!merge || (stage == 2))) { - cache_tree_free(&active_cache_tree); + if (trees && trees->item && (!merge || (stage == 2))) { + cache_tree_free(&active_cache_tree); prime_cache_tree(); }