Skip to content

Commit 727377f

Browse files
peffgitster
authored andcommitted
commit.c: make compare_commits_by_commit_date global
This helper function was introduced as a prio_queue comparator to help topological sorting. However, other users of prio_queue who want to replace commit_list_insert_by_date will want to use it, too. So let's make it public. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1644524 commit 727377f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ static int compare_commits_by_author_date(const void *a_, const void *b_,
581581
return 0;
582582
}
583583

584-
static int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused)
584+
int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused)
585585
{
586586
const struct commit *a = a_, *b = b_;
587587
/* newer commits with larger date first */

commit.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,6 @@ extern void print_commit_list(struct commit_list *list,
254254
*/
255255
extern void check_commit_signature(const struct commit* commit, struct signature_check *sigc);
256256

257+
int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused);
258+
257259
#endif /* COMMIT_H */

0 commit comments

Comments
 (0)