log: use commit-slab in prepare_bases() instead of commit->util
It's done so that commit->util can be removed. See more explanation in the commit that removes commit->util. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
44cecbf8a0
commit
7b680d32f3
@ -28,6 +28,7 @@
|
||||
#include "mailmap.h"
|
||||
#include "gpg-interface.h"
|
||||
#include "progress.h"
|
||||
#include "commit-slab.h"
|
||||
|
||||
#define MAIL_DEFAULT_WRAP 72
|
||||
|
||||
@ -1340,6 +1341,8 @@ static struct commit *get_base_commit(const char *base_commit,
|
||||
return base;
|
||||
}
|
||||
|
||||
define_commit_slab(commit_base, int);
|
||||
|
||||
static void prepare_bases(struct base_tree_info *bases,
|
||||
struct commit *base,
|
||||
struct commit **list,
|
||||
@ -1348,11 +1351,13 @@ static void prepare_bases(struct base_tree_info *bases,
|
||||
struct commit *commit;
|
||||
struct rev_info revs;
|
||||
struct diff_options diffopt;
|
||||
struct commit_base commit_base;
|
||||
int i;
|
||||
|
||||
if (!base)
|
||||
return;
|
||||
|
||||
init_commit_base(&commit_base);
|
||||
diff_setup(&diffopt);
|
||||
diffopt.flags.recursive = 1;
|
||||
diff_setup_done(&diffopt);
|
||||
@ -1365,7 +1370,7 @@ static void prepare_bases(struct base_tree_info *bases,
|
||||
for (i = 0; i < total; i++) {
|
||||
list[i]->object.flags &= ~UNINTERESTING;
|
||||
add_pending_object(&revs, &list[i]->object, "rev_list");
|
||||
list[i]->util = (void *)1;
|
||||
*commit_base_at(&commit_base, list[i]) = 1;
|
||||
}
|
||||
base->object.flags |= UNINTERESTING;
|
||||
add_pending_object(&revs, &base->object, "base");
|
||||
@ -1379,7 +1384,7 @@ static void prepare_bases(struct base_tree_info *bases,
|
||||
while ((commit = get_revision(&revs)) != NULL) {
|
||||
struct object_id oid;
|
||||
struct object_id *patch_id;
|
||||
if (commit->util)
|
||||
if (*commit_base_at(&commit_base, commit))
|
||||
continue;
|
||||
if (commit_patch_id(commit, &diffopt, &oid, 0))
|
||||
die(_("cannot get patch id"));
|
||||
@ -1388,6 +1393,7 @@ static void prepare_bases(struct base_tree_info *bases,
|
||||
oidcpy(patch_id, &oid);
|
||||
bases->nr_patch_id++;
|
||||
}
|
||||
clear_commit_base(&commit_base);
|
||||
}
|
||||
|
||||
static void print_bases(struct base_tree_info *bases, FILE *file)
|
||||
|
Loading…
Reference in New Issue
Block a user