Skip to content

Commit c4cc083

Browse files
derrickstoleegitster
authored andcommitted
commit-graph: use repo_parse_commit
The write_commit_graph_context has a repository pointer, so use it. Signed-off-by: Derrick Stolee <[email protected]> Reviewed-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5a3b130 commit c4cc083

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

commit-graph.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ static int write_graph_chunk_data(struct hashfile *f,
10981098
uint32_t packedDate[2];
10991099
display_progress(ctx->progress, ++ctx->progress_cnt);
11001100

1101-
if (parse_commit_no_graph(*list))
1101+
if (repo_parse_commit_no_graph(ctx->r, *list))
11021102
die(_("unable to parse commit %s"),
11031103
oid_to_hex(&(*list)->object.oid));
11041104
tree = get_commit_tree_oid(*list);
@@ -1411,11 +1411,11 @@ static void close_reachable(struct write_commit_graph_context *ctx)
14111411
if (!commit)
14121412
continue;
14131413
if (ctx->split) {
1414-
if ((!parse_commit(commit) &&
1414+
if ((!repo_parse_commit(ctx->r, commit) &&
14151415
commit_graph_position(commit) == COMMIT_NOT_FROM_GRAPH) ||
14161416
flags == COMMIT_GRAPH_SPLIT_REPLACE)
14171417
add_missing_parents(ctx, commit);
1418-
} else if (!parse_commit_no_graph(commit))
1418+
} else if (!repo_parse_commit_no_graph(ctx->r, commit))
14191419
add_missing_parents(ctx, commit);
14201420
}
14211421
stop_progress(&ctx->progress);
@@ -1710,9 +1710,9 @@ static void copy_oids_to_commits(struct write_commit_graph_context *ctx)
17101710
continue;
17111711

17121712
if (ctx->split && flags == COMMIT_GRAPH_SPLIT_REPLACE)
1713-
parse_commit(ctx->commits.list[ctx->commits.nr]);
1713+
repo_parse_commit(ctx->r, ctx->commits.list[ctx->commits.nr]);
17141714
else
1715-
parse_commit_no_graph(ctx->commits.list[ctx->commits.nr]);
1715+
repo_parse_commit_no_graph(ctx->r, ctx->commits.list[ctx->commits.nr]);
17161716

17171717
num_parents = commit_list_count(ctx->commits.list[ctx->commits.nr]->parents);
17181718
if (num_parents > 2)

commit.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ static inline int repo_parse_commit(struct repository *r, struct commit *item)
8989
return repo_parse_commit_gently(r, item, 0);
9090
}
9191

92-
static inline int parse_commit_no_graph(struct commit *commit)
92+
static inline int repo_parse_commit_no_graph(struct repository *r,
93+
struct commit *commit)
9394
{
94-
return repo_parse_commit_internal(the_repository, commit, 0, 0);
95+
return repo_parse_commit_internal(r, commit, 0, 0);
9596
}
9697

9798
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS

0 commit comments

Comments
 (0)