]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-log: honor id=sha1 on querystring
authorLars Hjemli <hjemli@gmail.com>
Sun, 17 Jun 2007 12:58:45 +0000 (14:58 +0200)
committerLars Hjemli <hjemli@gmail.com>
Sun, 17 Jun 2007 12:58:45 +0000 (14:58 +0200)
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
ui-log.c

diff --git a/cgit.c b/cgit.c
index f5135d9242dd07175909e999e5ec69d648c48907..b936a700c53957ae529485775808a6460125aa98 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -92,7 +92,7 @@ static void cgit_print_repo_page(struct cacheitem *item)
 
        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;
index 8d774b05669f36a820c892e24c21c71275ba4deb..95cb453c958611521cb54378933ecb6892905d52 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -59,6 +59,9 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, i
        int argc = 2;
        int i;
 
+       if (!tip)
+               argv[1] = cgit_query_head;
+
        if (grep)
                argv[argc++] = fmt("--grep=%s", grep);
        if (path) {