Fix generation of Blame url

The Blame URLs returned by `url_for` currently return e.g. `b'master'`
for the ref component, breaking the "Blame" tab. Example:

https://git.sr.ht/~yyny/test/blame/b%27master%27/README.md

This patch fixes that.
This commit is contained in:
Jonne Ransijn 2024-04-15 00:31:52 +02:00 committed by Drew DeVault
parent 7144962487
commit 2b4c2f9972
1 changed files with 1 additions and 1 deletions

View File

@ -416,7 +416,7 @@ def weld_hunks(blame):
yield last
@repo.route("/<owner>/<repo>/blame/<path:ref>", defaults={"path": ""})
@repo.route("/<owner>/<repo>/blame/<ref>/<path:path>")
@repo.route("/<owner>/<repo>/blame/<path:ref>/<path:path>")
def blame(owner, repo, ref, path):
owner, repo = get_repo_or_redir(owner, repo)
with GitRepository(repo.path) as git_repo: