Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit ba267cb

Browse files
committed
references: sort: compare author timestamps when commit timestamps are equal. Fixes #725
Signed-off-by: Alexandr Krylovskiy <alexandr.krylovskiy@gmail.com>
1 parent f6aca08 commit ba267cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

references.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ func (s commitSorterer) Len() int {
4747
}
4848

4949
func (s commitSorterer) Less(i, j int) bool {
50-
return s.l[i].Committer.When.Before(s.l[j].Committer.When)
50+
return s.l[i].Committer.When.Before(s.l[j].Committer.When) ||
51+
s.l[i].Committer.When.Equal(s.l[j].Committer.When) &&
52+
s.l[i].Author.When.Before(s.l[j].Author.When)
5153
}
5254

5355
func (s commitSorterer) Swap(i, j int) {

0 commit comments

Comments
 (0)