This is suddenly useful after the repo.defbranch-related changes.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
const char *query)
{
if (cgit_virtual_root) {
- return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame,
- pagename, query);
+ if (query)
+ return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame,
+ pagename, query);
+ else
+ return fmt("%s/%s/%s/", cgit_virtual_root, reponame,
+ pagename);
} else {
return fmt("?r=%s&p=%s&%s", reponame, pagename, query);
}