diff options
| author | Vicent Marti <tanoku@gmail.com> | 2010-05-25 22:00:55 +0200 |
|---|---|---|
| committer | Andreas Ericsson <ae@op5.se> | 2010-06-02 10:32:07 +0200 |
| commit | 82b1db3b35e34c87862172bf3f4705c4aca8cc98 (patch) | |
| tree | b31b32f52231610f4e8c2c98e1ba5834b323555d | |
| parent | e5d1faefab1bb51f3d0fff2d5e2cfe4fe96a9c22 (diff) | |
| download | libgit2-82b1db3b35e34c87862172bf3f4705c4aca8cc98.tar.gz | |
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>
| -rw-r--r-- | src/commit.c | 2 | ||||
| -rw-r--r-- | tests/t0403-lists.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/commit.c b/src/commit.c index 9b52f4120..2e3e1ba4b 100644 --- a/src/commit.c +++ b/src/commit.c @@ -350,7 +350,7 @@ void git_commit_list_timesort(git_commit_list *list) e = q, q = q->next, q_size--; 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--; else diff --git a/tests/t0403-lists.c b/tests/t0403-lists.c index c16281e32..ff4fd6b1c 100644 --- a/tests/t0403-lists.c +++ b/tests/t0403-lists.c @@ -12,10 +12,10 @@ BEGIN_TEST(list_timesort_test) time_t previous_time; #define TEST_SORTED() \ - previous_time = 0;\ + previous_time = INT_MAX;\ 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;\ } |
