X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/59d8fa1a62e7c19911fdf7ee9ceb0fdf8fa3331c..205837d4684f331afa93c946cbdfa1fa9b3d1ce9:/ui-log.c diff --git a/ui-log.c b/ui-log.c index d6d94f6..2939c01 100644 --- a/ui-log.c +++ b/ui-log.c @@ -49,7 +49,7 @@ static void inspect_files(struct diff_filepair *pair) files++; if (ctx.repo->enable_log_linecount) - cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, + cgit_diff_files(&pair->one->oid, &pair->two->oid, &old_size, &new_size, &binary, 0, ctx.qry.ignorews, count_lines); } @@ -65,7 +65,9 @@ void show_commit_decorations(struct commit *commit) return; html(""); while (deco) { - strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1); + struct object_id peeled; + int is_annotated = 0; + strlcpy(buf, prettify_refname(deco->name), sizeof(buf)); switch(deco->type) { case DECORATION_NONE: /* If the git-core doesn't recognize it, @@ -77,7 +79,9 @@ void show_commit_decorations(struct commit *commit) ctx.qry.showmsg, 0); break; case DECORATION_REF_TAG: - cgit_tag_link(buf, NULL, "tag-deco", buf); + if (!peel_ref(deco->name, &peeled)) + is_annotated = !oidcmp(&commit->object.oid, &peeled); + cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf); break; case DECORATION_REF_REMOTE: if (!ctx.repo->enable_remote_branches) @@ -119,8 +123,7 @@ static int show_commit(struct commit *commit, struct rev_info *revs) struct commit_list *parents = commit->parents; struct commit *parent; int found = 0, saved_fmt; - unsigned saved_flags = revs->diffopt.flags; - + struct diff_flags saved_flags = revs->diffopt.flags; /* Always show if we're not in "follow" mode with a single file. */ if (!ctx.qry.follow) @@ -149,10 +152,10 @@ static int show_commit(struct commit *commit, struct rev_info *revs) add_lines = 0; rem_lines = 0; - DIFF_OPT_SET(&revs->diffopt, RECURSIVE); - diff_tree_sha1(parent->tree->object.oid.hash, - commit->tree->object.oid.hash, - "", &revs->diffopt); + revs->diffopt.flags.recursive = 1; + diff_tree_oid(get_commit_tree_oid(parent), + get_commit_tree_oid(commit), + "", &revs->diffopt); diffcore_std(&revs->diffopt); found = !diff_queue_is_empty(); @@ -231,7 +234,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) strbuf_add(&msgbuf, "\n\n", 2); /* Place wrap_symbol at position i in info->subject */ - strcpy(info->subject + i, wrap_symbol); + strlcpy(info->subject + i, wrap_symbol, subject_len - i + 1); } } cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, @@ -258,12 +261,14 @@ static void print_commit(struct commit *commit, struct rev_info *revs) if (ctx.repo->enable_log_filecount) htmlf("