fast-import: Fix crash when referencing already existing objects
[gitweb.git] / fetch.c
diff --git a/fetch.c b/fetch.c
index 663b4b2f42744a2d12ba1d8661b8b0d3645ef82b..8e29d313f817981a29ebb65f2f579c9f1bd8e9b6 100644 (file)
--- a/fetch.c
+++ b/fetch.c
@@ -1,6 +1,5 @@
-#include "fetch.h"
-
 #include "cache.h"
+#include "fetch.h"
 #include "commit.h"
 #include "tree.h"
 #include "tree-walk.h"
@@ -43,8 +42,7 @@ static int process_tree(struct tree *tree)
        if (parse_tree(tree))
                return -1;
 
-       desc.buf = tree->buffer;
-       desc.size = tree->size;
+       init_tree_desc(&desc, tree->buffer, tree->size);
        while (tree_entry(&desc, &entry)) {
                struct object *obj = NULL;