aboutsummaryrefslogtreecommitdiffstats
path: root/references.go
diff options
context:
space:
mode:
authorAlexandr Krylovskiy <alexandr.krylovskiy@gmail.com>2018-01-21 14:42:39 +0100
committerAlexandr Krylovskiy <alexandr.krylovskiy@gmail.com>2018-01-21 14:42:39 +0100
commitba267cb676e2ab06fc57e1612f7534d1d8501957 (patch)
tree4ae235fa71faf24b76c6c0fbc9e59b2adadf05fe /references.go
parentf6aca0820fb0a44d4c4875a21581a09609d63a6b (diff)
downloadgo-git-ba267cb676e2ab06fc57e1612f7534d1d8501957.tar.gz
references: sort: compare author timestamps when commit timestamps are equal. Fixes #725
Signed-off-by: Alexandr Krylovskiy <alexandr.krylovskiy@gmail.com>
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) {