mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-18 03:30:55 +01:00
Correctly support branch names with slashes
Previously, branches with slashes in the name would consume all slashed segments in a URL, causing the routes to capture incorrect file paths. This solution is not particularly elegant - anywhere a route used both a commit-ish identifier and a path, we collapse those two params into a single param, and parse that param inside the route. It seems to be working reasonably reliably, but has not seen extensive testing. It is also not particularly pretty. If anyone sees ways to improve it, please, have at it.
This commit is contained in:
@@ -30,8 +30,8 @@
|
||||
<div class="meta"><a name="{{ loop.index }}">{{ diff.file }}</div>
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<a href="{{ path('commits', {repo: repo, branch: commit.hash, file: diff.file}) }}" class="btn btn-small"><i class="icon-list-alt"></i> History</a>
|
||||
<a href="{{ path('blob', {repo: repo, branch: commit.hash, file: diff.file}) }}" class="btn btn-small"><i class="icon-file"></i> View file @ {{ commit.shortHash }}</a>
|
||||
<a href="{{ path('commits', {repo: repo, commitish_path: commit.hash ~ '/' ~ diff.file}) }}" class="btn btn-small"><i class="icon-list-alt"></i> History</a>
|
||||
<a href="{{ path('blob', {repo: repo, commitish_path: commit.hash ~'/' ~ diff.file}) }}" class="btn btn-small"><i class="icon-file"></i> View file @ {{ commit.shortHash }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user