Author: Lars Hjemli <hjemli@gmail.com>
ui-log: honor id=sha1 on querystring This teaches ui-log to prefer id=sha1 and fallback to h=rev if no id- parameter is specified. With this change, summary, log, commit and tree views now passes current branch using h parameter and current revision using id parameter. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
cgit.c | 2 +- ui-log.c | 3 +++
diff --git a/cgit.c b/cgit.c index f5135d9242dd07175909e999e5ec69d648c48907..b936a700c53957ae529485775808a6460125aa98 100644 --- a/cgit.c +++ b/cgit.c @@ -92,7 +92,7 @@ cgit_print_pageheader(cgit_query_page, show_search); switch(cgit_cmd) { case CMD_LOG: - cgit_print_log(cgit_query_head, cgit_query_ofs, + cgit_print_log(cgit_query_sha1, cgit_query_ofs, cgit_max_commit_count, cgit_query_search, cgit_query_path, 1); break; diff --git a/ui-log.c b/ui-log.c index 8d774b05669f36a820c892e24c21c71275ba4deb..95cb453c958611521cb54378933ecb6892905d52 100644 --- a/ui-log.c +++ b/ui-log.c @@ -59,6 +59,9 @@ const char *argv[] = {NULL, tip, NULL, NULL, NULL}; int argc = 2; int i; + if (!tip) + argv[1] = cgit_query_head; + if (grep) argv[argc++] = fmt("--grep=%s", grep); if (path) {