[PATCH] fetch.c: Remove call to parse_object() from process()
[git.git] / fetch.c
diff --git a/fetch.c b/fetch.c
index be3dc0a..e6fd624 100644 (file)
--- a/fetch.c
+++ b/fetch.c
@@ -54,10 +54,9 @@ static int process_tree(struct tree *tree)
        return 0;
 }
 
-#define COMPLETE       1U
-#define TO_FETCH       2U
-#define TO_SCAN                4U
-#define SCANNED                8U
+#define COMPLETE       (1U << 0)
+#define SEEN           (1U << 1)
+#define TO_SCAN                (1U << 2)
 
 static struct commit_list *complete = NULL;
 
@@ -105,10 +104,6 @@ static struct object_list **process_queue_end = &process_queue;
 
 static int process_object(struct object *obj)
 {
-       if (obj->flags & SCANNED)
-               return 0;
-       obj->flags |= SCANNED;
-
        if (obj->type == commit_type) {
                if (process_commit((struct commit *)obj))
                        return -1;
@@ -134,24 +129,21 @@ static int process_object(struct object *obj)
 
 static int process(struct object *obj)
 {
+       if (obj->flags & SEEN)
+               return 0;
+       obj->flags |= SEEN;
+
        if (has_sha1_file(obj->sha1)) {
-               parse_object(obj->sha1);
                /* We already have it, so we should scan it now. */
-               if (obj->flags & (SCANNED | TO_SCAN))
-                       return 0;
-               object_list_insert(obj, process_queue_end);
-               process_queue_end = &(*process_queue_end)->next;
                obj->flags |= TO_SCAN;
-               return 0;
+       } else {
+               if (obj->flags & COMPLETE)
+                       return 0;
+               prefetch(obj->sha1);
        }
-       if (obj->flags & (COMPLETE | TO_FETCH))
-               return 0;
+               
        object_list_insert(obj, process_queue_end);
        process_queue_end = &(*process_queue_end)->next;
-       obj->flags |= TO_FETCH;
-
-       prefetch(obj->sha1);
-               
        return 0;
 }