Skip to content

Commit 3cbc6ed

Browse files
derrickstoleegitster
authored andcommitted
commit-graph: rename commit_compare to oid_compare
The helper function commit_compare() actually compares object_id structs, not commits. A future change to commit-graph.c will need to sort commit structs, so rename this function in advance. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d4f4d60 commit 3cbc6ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

commit-graph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static void write_graph_chunk_extra_edges(struct hashfile *f,
770770
}
771771
}
772772

773-
static int commit_compare(const void *_a, const void *_b)
773+
static int oid_compare(const void *_a, const void *_b)
774774
{
775775
const struct object_id *a = (const struct object_id *)_a;
776776
const struct object_id *b = (const struct object_id *)_b;
@@ -1039,7 +1039,7 @@ static uint32_t count_distinct_commits(struct write_commit_graph_context *ctx)
10391039
_("Counting distinct commits in commit graph"),
10401040
ctx->oids.nr);
10411041
display_progress(ctx->progress, 0); /* TODO: Measure QSORT() progress */
1042-
QSORT(ctx->oids.list, ctx->oids.nr, commit_compare);
1042+
QSORT(ctx->oids.list, ctx->oids.nr, oid_compare);
10431043

10441044
for (i = 1; i < ctx->oids.nr; i++) {
10451045
display_progress(ctx->progress, i + 1);

0 commit comments

Comments
 (0)