]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit.c: make compare_commits_by_commit_date global
authorJeff King <peff@peff.net>
Tue, 2 Jul 2013 06:21:48 +0000 (02:21 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Jul 2013 19:03:50 +0000 (12:03 -0700)
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c
commit.h

index 521e49c3094acc06340e15f7be27722be9b03ee8..ebc0eeab8f9c1678f3780991a9414f2261215427 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -581,7 +581,7 @@ static int compare_commits_by_author_date(const void *a_, const void *b_,
        return 0;
 }
 
-static int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused)
+int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused)
 {
        const struct commit *a = a_, *b = b_;
        /* newer commits with larger date first */
index 4d452dc96db3d5590878ab6f257022fe76b4130b..18a523495eb7be3636f4f1311375fdb35329da9e 100644 (file)
--- a/commit.h
+++ b/commit.h
@@ -254,4 +254,6 @@ extern void print_commit_list(struct commit_list *list,
  */
 extern void check_commit_signature(const struct commit* commit, struct signature_check *sigc);
 
+int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused);
+
 #endif /* COMMIT_H */