Browse Source

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>
maint
Johannes Schindelin 19 years ago committed by Junio C Hamano
parent
commit
b6c4a480b3
  1. 4
      read-tree.c

4
read-tree.c

@ -881,8 +881,8 @@ int main(int argc, char **argv) @@ -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();
}


Loading…
Cancel
Save