@matheusbsbs / matheus-bagliano / commits / b6c4a480b3
Fork 0

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 <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed May 7, 2006 at 17:42 UTC b6c4a480b3161effaa3578df91d8cdc83044d7b6
1 file changed +2 -2
read-tree.c
+2 -2
@@ -881,8 +881,8 @@ int main(int argc, char **argv)
881 * valid cache-tree because the index must match exactly
882 * what came from the tree.
883 */
884 - if (trees->item && (!merge || (stage == 2))) {
885 - cache_tree_free(&active_cache_tree);
884 + if (trees && trees->item && (!merge || (stage == 2))) {
885 + cache_tree_free(&active_cache_tree);
886 prime_cache_tree();
887 }
888