summaryrefslogtreecommitdiff
path: root/reflog.c
diff options
context:
space:
mode:
Diffstat (limited to 'reflog.c')
-rw-r--r--reflog.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/reflog.c b/reflog.c
index 15d81ebea9..ac87e20c4f 100644
--- a/reflog.c
+++ b/reflog.c
@@ -3,9 +3,10 @@
#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "parse-options.h"
-#include "object-store.h"
+#include "odb.h"
#include "reflog.h"
#include "refs.h"
#include "revision.h"
@@ -81,6 +82,20 @@ int reflog_expire_config(const char *var, const char *value,
return 0;
}
+void reflog_clear_expire_config(struct reflog_expire_options *opts)
+{
+ struct reflog_expire_entry_option *ent = opts->entries, *tmp;
+
+ while (ent) {
+ tmp = ent;
+ ent = ent->next;
+ free(tmp);
+ }
+
+ opts->entries = NULL;
+ opts->entries_tail = NULL;
+}
+
void reflog_expire_options_set_refname(struct reflog_expire_options *cb,
const char *ref)
{
@@ -140,8 +155,8 @@ static int tree_is_complete(const struct object_id *oid)
if (!tree->buffer) {
enum object_type type;
unsigned long size;
- void *data = repo_read_object_file(the_repository, oid, &type,
- &size);
+ void *data = odb_read_object(the_repository->objects, oid,
+ &type, &size);
if (!data) {
tree->object.flags |= INCOMPLETE;
return 0;
@@ -152,7 +167,7 @@ static int tree_is_complete(const struct object_id *oid)
init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
complete = 1;
while (tree_entry(&desc, &entry)) {
- if (!has_object(the_repository, &entry.oid,
+ if (!odb_has_object(the_repository->objects, &entry.oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR) ||
(S_ISDIR(entry.mode) && !tree_is_complete(&entry.oid))) {
tree->object.flags |= INCOMPLETE;
@@ -408,16 +423,13 @@ int should_expire_reflog_ent_verbose(struct object_id *ooid,
return expire;
}
-static int push_tip_to_list(const char *refname UNUSED,
- const char *referent UNUSED,
- const struct object_id *oid,
- int flags, void *cb_data)
+static int push_tip_to_list(const struct reference *ref, void *cb_data)
{
struct commit_list **list = cb_data;
struct commit *tip_commit;
- if (flags & REF_ISSYMREF)
+ if (ref->flags & REF_ISSYMREF)
return 0;
- tip_commit = lookup_commit_reference_gently(the_repository, oid, 1);
+ tip_commit = lookup_commit_reference_gently(the_repository, ref->oid, 1);
if (!tip_commit)
return 0;
commit_list_insert(tip_commit, list);
@@ -492,7 +504,8 @@ void reflog_expiry_cleanup(void *cb_data)
free_commit_list(cb->mark_list);
}
-int count_reflog_ent(struct object_id *ooid UNUSED,
+int count_reflog_ent(const char *refname UNUSED,
+ struct object_id *ooid UNUSED,
struct object_id *noid UNUSED,
const char *email UNUSED,
timestamp_t timestamp, int tz UNUSED,