]> git.ipfire.org Git - thirdparty/git.git/blobdiff - reflog-walk.c
Merge branch 'en/ort-perf-batch-9'
[thirdparty/git.git] / reflog-walk.c
index 5008bbf6ada3707009722e3a3ca5b37437fbfb24..e9cd3283694decbc6ea8e72c5681766129df793d 100644 (file)
@@ -112,7 +112,7 @@ struct reflog_walk_info {
 
 void init_reflog_walk(struct reflog_walk_info **info)
 {
-       *info = xcalloc(1, sizeof(struct reflog_walk_info));
+       CALLOC_ARRAY(*info, 1);
        (*info)->complete_reflogs.strdup_strings = 1;
 }
 
@@ -128,7 +128,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,
        enum selector_type selector = SELECTOR_NONE;
 
        if (commit->object.flags & UNINTERESTING)
-               die ("Cannot walk reflogs for %s", name);
+               die("cannot walk reflogs for %s", name);
 
        branch = xstrdup(name);
        if (at && at[1] == '{') {
@@ -153,7 +153,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,
                        free(branch);
                        branch = resolve_refdup("HEAD", 0, NULL, NULL);
                        if (!branch)
-                               die ("No current branch");
+                               die("no current branch");
 
                }
                reflogs = read_complete_reflog(branch);
@@ -181,7 +181,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,
        }
        free(branch);
 
-       commit_reflog = xcalloc(1, sizeof(struct commit_reflog));
+       CALLOC_ARRAY(commit_reflog, 1);
        if (recno < 0) {
                commit_reflog->recno = get_reflog_recno_by_time(reflogs, timestamp);
                if (commit_reflog->recno < 0) {
@@ -305,7 +305,8 @@ static struct commit *next_reflog_commit(struct commit_reflog *log)
 {
        for (; log->recno >= 0; log->recno--) {
                struct reflog_info *entry = &log->reflogs->items[log->recno];
-               struct object *obj = parse_object(&entry->noid);
+               struct object *obj = parse_object(the_repository,
+                                                 &entry->noid);
 
                if (obj && obj->type == OBJ_COMMIT)
                        return (struct commit *)obj;