]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
ui-repolist: add support for sorting any column
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 5a93fcdc6376a9a1ad7ac1f7090988c624481294..e09c86eaae248ead1fbcca8ee51224b98ccf94af 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -154,6 +154,8 @@ static void querystring_cb(const char *name, const char *value)
                ctx.qry.name = xstrdup(value);
        } else if (!strcmp(name, "mimetype")) {
                ctx.qry.mimetype = xstrdup(value);
+       } else if (!strcmp(name, "s")){
+               ctx.qry.sort = xstrdup(value);
        }
 }
 
@@ -254,6 +256,7 @@ static int prepare_repo_cmd(struct cgit_context *ctx)
        ctx->page.title = fmt("%s - %s", ctx->repo->name, ctx->repo->desc);
 
        if (!ctx->qry.head) {
+               ctx->qry.nohead = 1;
                ctx->qry.head = find_default_branch(ctx->repo);
                ctx->repo->defbranch = ctx->qry.head;
        }