diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-18 02:14:43 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-01-17 20:54:11 -0500 |
commit | 9a15bfb7bec07462f04b3d15f1318fac99b1b30a (patch) | |
tree | d475e237df38789d589f0b936fa8195d665862a0 /gitsrht/blueprints/repo.py | |
parent | 3dd257c7f966237329b9071be5581a44269209b5 (diff) |
List default branch first on refs page
Diffstat (limited to 'gitsrht/blueprints/repo.py')
-rw-r--r-- | gitsrht/blueprints/repo.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 2c1ae44..71b123d 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -409,7 +409,10 @@ def refs(owner, repo): git_repo.branches[branch], git_repo.get(git_repo.branches[branch].target) ) for branch in git_repo.branches.local] - branches = sorted(branches, key=lambda b: b[2].commit_time, reverse=True) + default_branch = git_repo.default_branch().name + branches = sorted(branches, + key=lambda b: (b[1].name == default_branch, b[2].commit_time), + reverse=True) results_per_page = 10 page = request.args.get("page") |