]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
ui-repolist: extract repo visibility criteria to separate function
[ps-cgit] / ui-shared.c
index c04f380be52defbcfb2afb9187b61529c24e68ed..5b487342d7f09e0faca82cbdb195aa8ae076b6aa 100644 (file)
@@ -525,7 +525,7 @@ void cgit_object_link(struct object *obj)
 {
        char *page, *shortrev, *fullrev, *name;
 
-       fullrev = sha1_to_hex(obj->sha1);
+       fullrev = oid_to_hex(&obj->oid);
        shortrev = xstrdup(fullrev);
        shortrev[10] = '\0';
        if (obj->type == OBJ_COMMIT) {
@@ -889,6 +889,9 @@ void cgit_add_hidden_formfields(int incl_head, int incl_search,
 
 static const char *hc(const char *page)
 {
+       if (!ctx.qry.page)
+               return NULL;
+
        return strcmp(ctx.qry.page, page) ? NULL : "active";
 }