[PATCH] Fix crash when reading the empty tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



cvsimport needs to call git-read-tree without arguments to create an empty
tree.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@xxxxxx>
---
 read-tree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/read-tree.c b/read-tree.c
index 067fb95..a060a97 100644
--- a/read-tree.c
+++ b/read-tree.c
@@ -881,7 +881,7 @@ 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))) {
+	if (trees && trees->item && (!merge || (stage == 2))) {
 		cache_tree_free(&active_cache_tree);		
 		prime_cache_tree();
 	}
-- 
1.3.2.g5131-dirty

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]