~edwargix/git.sr.ht

591673fabd2ca045c3a75e991152fdcdff666286 — Nolan Prescott 3 years ago 48dcdbd
Allow "path" refs in repo links

This change should fix the refs URLs using the same approach taken in
the archive URL routing which is to capture the subpath, slashes and
all as the ref name.

Intended to address the first part of this ticket:

https://todo.sr.ht/~sircmpwn/git.sr.ht/323
1 files changed, 1 insertions(+), 1 deletions(-)

M gitsrht/blueprints/repo.py
M gitsrht/blueprints/repo.py => gitsrht/blueprints/repo.py +1 -1
@@ 567,7 567,7 @@ def refs_rss(owner, repo):

    return generate_feed(repo, references, title, link, description)

@repo.route("/<owner>/<repo>/refs/<ref>")
@repo.route("/<owner>/<repo>/refs/<path:ref>")
def ref(owner, repo, ref):
    owner, repo = get_repo_or_redir(owner, repo)
    with GitRepository(repo.path) as git_repo: