revision.c: reduce implicit dependency the_repository
[gitweb.git] / builtin / rev-list.c
index cce42ae1dd3eadc3b902f4a0a05089577529faa7..c60504891a56088454574297602bc4fcb1343743 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;
 }
 
@@ -369,7 +370,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
                usage(rev_list_usage);
 
        git_config(git_default_config, NULL);
-       init_revisions(&revs, prefix);
+       repo_init_revisions(the_repository, &revs, prefix);
        revs.abbrev = DEFAULT_ABBREV;
        revs.commit_format = CMIT_FMT_UNSPECIFIED;
 
@@ -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;
                        }
                }