Skip to content

Commit

Permalink
Fix crash when reading the empty tree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed May 7, 2006
1 parent 6d60bbe commit b6c4a48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions read-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit b6c4a48

Please sign in to comment.