]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-stats.c
git: update to v2.46.0
[ps-cgit] / ui-stats.c
index 09b3625e7e0cc8e0c13edbf5690f00c9da8ab3a6..02c60efa2a5c9ff1f5a168acb2459f79e778f51c 100644 (file)
@@ -1,3 +1,13 @@
+/* ui-stats.c: generate stats view
+ *
+ * Copyright (C) 2006-2014 cgit Development Team <cgit@lists.zx2c4.com>
+ *
+ * Licensed under GNU General Public License v2
+ *   (see COPYING for full license text)
+ */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-stats.h"
 #include "html.h"
@@ -230,7 +240,7 @@ static struct string_list collect_stats(const struct cgit_period *period)
                argv[4] = ctx.qry.path;
                argc += 2;
        }
-       init_revisions(&rev, NULL);
+       repo_init_revisions(the_repository, &rev, NULL);
        rev.abbrev = DEFAULT_ABBREV;
        rev.commit_format = CMIT_FMT_DEFAULT;
        rev.max_parents = 1;
@@ -241,8 +251,7 @@ static struct string_list collect_stats(const struct cgit_period *period)
        memset(&authors, 0, sizeof(authors));
        while ((commit = get_revision(&rev)) != NULL) {
                add_commit(&authors, commit, period);
-               free_commit_buffer(the_repository->parsed_objects, commit);
-               free_commit_list(commit->parents);
+               release_commit_memory(the_repository->parsed_objects, commit);
                commit->parents = NULL;
        }
        return authors;