summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorAbhishek Kumar <abhishekkumar8222@gmail.com>2020-06-17 09:14:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-17 21:37:30 (GMT)
commitc49c82aa4c1036ba1629f73223cff53230e695f3 (patch)
tree91592f05de84792ad87abc8515662353a4fe6390 /revision.c
parent4844812b9ec9bc6ffdc2da2c54d9146ff4c97d94 (diff)
downloadgit-c49c82aa4c1036ba1629f73223cff53230e695f3.zip
git-c49c82aa4c1036ba1629f73223cff53230e695f3.tar.gz
git-c49c82aa4c1036ba1629f73223cff53230e695f3.tar.bz2
commit: move members graph_pos, generation to a slab
We remove members `graph_pos` and `generation` from the struct commit. The default assignments in init_commit_node() are no longer valid, which is fine as the slab helpers return appropriate default values and the assignments are removed. We will replace existing use of commit->generation and commit->graph_pos by commit_graph_data_slab helpers using `contrib/coccinelle/commit.cocci'. Signed-off-by: Abhishek Kumar <abhishekkumar8222@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/revision.c b/revision.c
index ebb4d2a..8648d7c 100644
--- a/revision.c
+++ b/revision.c
@@ -725,7 +725,7 @@ static int check_maybe_different_in_bloom_filter(struct rev_info *revs,
if (!revs->repo->objects->commit_graph)
return -1;
- if (commit->generation == GENERATION_NUMBER_INFINITY)
+ if (commit_graph_generation(commit) == GENERATION_NUMBER_INFINITY)
return -1;
filter = get_bloom_filter(revs->repo, commit, 0);
@@ -3320,7 +3320,7 @@ static void explore_to_depth(struct rev_info *revs,
struct topo_walk_info *info = revs->topo_walk_info;
struct commit *c;
while ((c = prio_queue_peek(&info->explore_queue)) &&
- c->generation >= gen_cutoff)
+ commit_graph_generation(c) >= gen_cutoff)
explore_walk_step(revs);
}
@@ -3336,7 +3336,7 @@ static void indegree_walk_step(struct rev_info *revs)
if (parse_commit_gently(c, 1) < 0)
return;
- explore_to_depth(revs, c->generation);
+ explore_to_depth(revs, commit_graph_generation(c));
for (p = c->parents; p; p = p->next) {
struct commit *parent = p->item;
@@ -3360,7 +3360,7 @@ static void compute_indegrees_to_depth(struct rev_info *revs,
struct topo_walk_info *info = revs->topo_walk_info;
struct commit *c;
while ((c = prio_queue_peek(&info->indegree_queue)) &&
- c->generation >= gen_cutoff)
+ commit_graph_generation(c) >= gen_cutoff)
indegree_walk_step(revs);
}
@@ -3420,8 +3420,8 @@ static void init_topo_walk(struct rev_info *revs)
test_flag_and_insert(&info->explore_queue, c, TOPO_WALK_EXPLORED);
test_flag_and_insert(&info->indegree_queue, c, TOPO_WALK_INDEGREE);
- if (c->generation < info->min_generation)
- info->min_generation = c->generation;
+ if (commit_graph_generation(c) < info->min_generation)
+ info->min_generation = commit_graph_generation(c);
*(indegree_slab_at(&info->indegree, c)) = 1;
@@ -3479,8 +3479,8 @@ static void expand_topo_walk(struct rev_info *revs, struct commit *commit)
if (parse_commit_gently(parent, 1) < 0)
continue;
- if (parent->generation < info->min_generation) {
- info->min_generation = parent->generation;
+ if (commit_graph_generation(parent) < info->min_generation) {
+ info->min_generation = commit_graph_generation(parent);
compute_indegrees_to_depth(revs, info->min_generation);
}