From c08a9c71eb564b145f296c07536bb3514776906a Mon Sep 17 00:00:00 2001 From: Nolan Prescott Date: Thu, 29 Oct 2020 21:55:37 -0400 Subject: [PATCH] Sort refs by commit date instead of tag date Previously, git refs listed in reverse chronological order based on tag-time. Now, list in reverse chronological order based on commit-time of the referenced commit. Intended to address: https://todo.sr.ht/~sircmpwn/git.sr.ht/322 --- gitsrht/blueprints/repo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index c0a9764..1936a5e 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -505,7 +505,7 @@ def refs(owner, repo): def _tag_key(tag): if isinstance(tag[1], pygit2.Commit): return tag[1].commit_time - return tag[1].tagger.time + return tag[1].get_object().commit_time tags = sorted(tags, key=_tag_key, reverse=True) branches = [( branch, -- 2.38.4