aboutsummaryrefslogtreecommitdiffstats
path: root/references.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-10-15 12:07:06 +0200
committerGitHub <noreply@github.com>2018-10-15 12:07:06 +0200
commit345ffd95a2cd1413d7f48280e21a035febbe4e10 (patch)
tree905a57b513b9029dc3e7b65277d9077ba064f98e /references.go
parent03810084a0cdb9eb432651979b0784a9fd92736a (diff)
parente250584026a05e5b4145349cd6462596dbe0f37a (diff)
downloadgo-git-345ffd95a2cd1413d7f48280e21a035febbe4e10.tar.gz
Merge pull request #727 from krylovsk/bugfix/references-sort-timestamps
references: sort: compare author timestamps when commit timestamps are equal. Fixes #725
Diffstat (limited to 'references.go')
-rw-r--r--references.go4
1 files changed, 3 insertions, 1 deletions
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) {