From ba267cb676e2ab06fc57e1612f7534d1d8501957 Mon Sep 17 00:00:00 2001 From: Alexandr Krylovskiy Date: Sun, 21 Jan 2018 14:42:39 +0100 Subject: references: sort: compare author timestamps when commit timestamps are equal. Fixes #725 Signed-off-by: Alexandr Krylovskiy --- references.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'references.go') diff --git a/references.go b/references.go index a1872a5..5673ac1 100644 --- a/references.go +++ b/references.go @@ -47,7 +47,9 @@ func (s commitSorterer) Len() int { } func (s commitSorterer) Less(i, j int) bool { - return s.l[i].Committer.When.Before(s.l[j].Committer.When) + return s.l[i].Committer.When.Before(s.l[j].Committer.When) || + s.l[i].Committer.When.Equal(s.l[j].Committer.When) && + s.l[i].Author.When.Before(s.l[j].Author.When) } func (s commitSorterer) Swap(i, j int) { -- cgit