summaryrefslogtreecommitdiffstats
path: root/gitsrht/blueprints/repo.py
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-18 02:14:43 +0100
committerDrew DeVault <sir@cmpwn.com>2019-01-17 20:54:11 -0500
commit9a15bfb7bec07462f04b3d15f1318fac99b1b30a (patch)
treed475e237df38789d589f0b936fa8195d665862a0 /gitsrht/blueprints/repo.py
parent3dd257c7f966237329b9071be5581a44269209b5 (diff)
List default branch first on refs page
Diffstat (limited to 'gitsrht/blueprints/repo.py')
-rw-r--r--gitsrht/blueprints/repo.py5
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")