dir.c: remove an implicit dependency on the_index in pathspec code
[gitweb.git] / builtin / rev-list.c
index cce42ae1dd3eadc3b902f4a0a05089577529faa7..5b07f3f4a2cf6cd5f73f20a930934ca2277c8391 100644 (file)
@@ -6,6 +6,7 @@
 #include "list-objects.h"
 #include "list-objects-filter.h"
 #include "list-objects-filter-options.h"
+#include "object-store.h"
 #include "pack.h"
 #include "pack-bitmap.h"
 #include "builtin.h"
@@ -239,7 +240,7 @@ static int finish_object(struct object *obj, const char *name, void *cb_data)
                return 1;
        }
        if (info->revs->verify_objects && !obj->parsed && obj->type != OBJ_COMMIT)
-               parse_object(&obj->oid);
+               parse_object(the_repository, &obj->oid);
        return 0;
 }
 
@@ -521,6 +522,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
                                if (max_count >= 0 && max_count < commit_count)
                                        commit_count = max_count;
                                printf("%d\n", commit_count);
+                               free_bitmap_index(bitmap_git);
                                return 0;
                        }
                } else if (revs.max_count < 0 &&
@@ -528,6 +530,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
                        struct bitmap_index *bitmap_git;
                        if ((bitmap_git = prepare_bitmap_walk(&revs))) {
                                traverse_bitmap_commit_list(bitmap_git, &show_object_fast);
+                               free_bitmap_index(bitmap_git);
                                return 0;
                        }
                }