Fix crash when reading the empty tree
[git.git] / checkout-index.c
index 7b78715..e56c354 100644 (file)
@@ -39,6 +39,7 @@
 #include "cache.h"
 #include "strbuf.h"
 #include "quote.h"
+#include "cache-tree.h"
 
 #define CHECKOUT_ALL 4
 static const char *prefix;
@@ -133,7 +134,7 @@ static int checkout_file(const char *name)
 static int checkout_all(void)
 {
        int i, errs = 0;
-       struct cache_entry* last_ce = 0;
+       struct cache_entry* last_ce = NULL;
 
        for (i = 0; i < active_nr ; i++) {
                struct cache_entry *ce = active_cache[i];