]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-log.c
ui-shared: redirect should not exit early for cache
[ps-cgit] / ui-log.c
index 0782478d3b6af207e86f0aff068fe7eb212b91fd..0a3938bf97c581b92e5ba0576d8232fd78c32a3a 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -82,14 +82,14 @@ void show_commit_decorations(struct commit *commit)
                                goto next;
                        strncpy(buf, deco->name + 13, sizeof(buf) - 1);
                        cgit_log_link(buf, NULL, "remote-deco", NULL,
-                                     sha1_to_hex(commit->object.sha1),
+                                     oid_to_hex(&commit->object.oid),
                                      ctx.qry.vpath, 0, NULL, NULL,
                                      ctx.qry.showmsg, 0);
                }
                else {
                        strncpy(buf, deco->name, sizeof(buf) - 1);
                        cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
-                                        sha1_to_hex(commit->object.sha1),
+                                        oid_to_hex(&commit->object.oid),
                                         ctx.qry.vpath);
                }
 next:
@@ -141,15 +141,17 @@ static int show_commit(struct commit *commit, struct rev_info *revs)
 
        /* When we get here we have precisely one parent. */
        parent = parents->item;
-       parse_commit(parent);
+       /* If we can't parse the commit, let print_commit() report an error. */
+       if (parse_commit(parent))
+               return 1;
 
        files = 0;
        add_lines = 0;
        rem_lines = 0;
 
        DIFF_OPT_SET(&revs->diffopt, RECURSIVE);
-       diff_tree_sha1(parent->tree->object.sha1,
-                      commit->tree->object.sha1,
+       diff_tree_sha1(parent->tree->object.oid.hash,
+                      commit->tree->object.oid.hash,
                       "", &revs->diffopt);
        diffcore_std(&revs->diffopt);
 
@@ -202,7 +204,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
        }
        else {
                html("<td>");
-               cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
+               cgit_print_age(info->committer_date, info->committer_tz, TM_WEEK * 2);
                html("</td>");
        }
 
@@ -233,7 +235,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
                }
        }
        cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
-                        sha1_to_hex(commit->object.sha1), ctx.qry.vpath);
+                        oid_to_hex(&commit->object.oid), ctx.qry.vpath);
        show_commit_decorations(commit);
        html("</td><td>");
        cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");
@@ -242,7 +244,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
 
        if (revs->graph) {
                html("</td><td>");
-               cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
+               cgit_print_age(info->committer_date, info->committer_tz, TM_WEEK * 2);
        }
 
        if (!lines_counted && (ctx.repo->enable_log_filecount ||
@@ -269,7 +271,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
                                strbuf_addstr(&msgbuf, info->msg);
                                strbuf_addch(&msgbuf, '\n');
                        }
-                       format_display_notes(commit->object.sha1,
+                       format_display_notes(commit->object.oid.hash,
                                             &msgbuf, PAGE_ENCODING, 0);
                        strbuf_addch(&msgbuf, '\n');
                        strbuf_ltrim(&msgbuf);