mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 12:24:58 +00:00
Changed commit time sorting to be descending (from newest to oldest).
Signed-off-by: Vicent Marti <tanoku@gmail.com> Signed-off-by: Andreas Ericsson <ae@op5.se>
This commit is contained in:
parent
e5d1faefab
commit
82b1db3b35
@ -350,7 +350,7 @@ void git_commit_list_timesort(git_commit_list *list)
|
|||||||
e = q, q = q->next, q_size--;
|
e = q, q = q->next, q_size--;
|
||||||
|
|
||||||
else if (q_size == 0 || q == NULL ||
|
else if (q_size == 0 || q == NULL ||
|
||||||
p->commit->commit_time <= q->commit->commit_time)
|
p->commit->commit_time >= q->commit->commit_time)
|
||||||
e = p, p = p->next, p_size--;
|
e = p, p = p->next, p_size--;
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -12,10 +12,10 @@ BEGIN_TEST(list_timesort_test)
|
|||||||
time_t previous_time;
|
time_t previous_time;
|
||||||
|
|
||||||
#define TEST_SORTED() \
|
#define TEST_SORTED() \
|
||||||
previous_time = 0;\
|
previous_time = INT_MAX;\
|
||||||
for (n = list.head; n != NULL; n = n->next)\
|
for (n = list.head; n != NULL; n = n->next)\
|
||||||
{\
|
{\
|
||||||
must_be_true(n->commit->commit_time >= previous_time);\
|
must_be_true(n->commit->commit_time <= previous_time);\
|
||||||
previous_time = n->commit->commit_time;\
|
previous_time = n->commit->commit_time;\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user