]> git.cameronkatri.com Git - cgit.git/blobdiff - ui-log.c
cgit.c: Remove parameter from guess_defbranch()
[cgit.git] / ui-log.c
index 4a295bd4a484bb86ba3373a07a62f3b2ed4b1d35..2f41602a917de13ac9f9daa6cdd50ff15afa3c27 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -76,6 +76,8 @@ void show_commit_decorations(struct commit *commit)
                        cgit_tag_link(buf, NULL, "tag-deco", ctx.qry.head, buf);
                }
                else if (!prefixcmp(deco->name, "refs/remotes/")) {
+                       if (!ctx.repo->enable_remote_branches)
+                               goto next;
                        strncpy(buf, deco->name + 13, sizeof(buf) - 1);
                        cgit_log_link(buf, NULL, "remote-deco", NULL,
                                      sha1_to_hex(commit->object.sha1),
@@ -88,6 +90,7 @@ void show_commit_decorations(struct commit *commit)
                                         sha1_to_hex(commit->object.sha1),
                                         ctx.qry.vpath, 0);
                }
+next:
                deco = deco->next;
        }
 }
@@ -275,7 +278,7 @@ static char *next_token(char **src)
 }
 
 void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern,
-                   char *path, int pager, int commit_graph)
+                   char *path, int pager, int commit_graph, int commit_sort)
 {
        struct rev_info rev;
        struct commit *commit;
@@ -324,6 +327,14 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
                                        COLUMN_COLORS_HTML_MAX);
        }
 
+       if (commit_sort == 1) {
+               static const char *date_order_arg = "--date-order";
+               vector_push(&vec, &date_order_arg, 0);
+       } else if (commit_sort == 2) {
+               static const char *topo_order_arg = "--topo-order";
+               vector_push(&vec, &topo_order_arg, 0);
+       }
+
        if (path) {
                arg = "--";
                vector_push(&vec, &arg, 0);