author | Lars Hjemli <hjemli@gmail.com> | 2009-02-01 18:29:47 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-02-01 18:29:47 (UTC) |
commit | 5e447b1ed1aa751e8ec93dccf4df6fa4a7ffddb6 (patch) (side-by-side diff) | |
tree | 823678b1c4a907cf0df50067c27fb5b752114df5 /ui-log.c | |
parent | 0b3c746ba80738dbe0885a21406409390936537c (diff) | |
parent | 481ce5e298e2dcd7edc1d4a30e523dda2ce58b01 (diff) | |
download | cgit-5e447b1ed1aa751e8ec93dccf4df6fa4a7ffddb6.zip cgit-5e447b1ed1aa751e8ec93dccf4df6fa4a7ffddb6.tar.gz cgit-5e447b1ed1aa751e8ec93dccf4df6fa4a7ffddb6.tar.bz2 |
Merge branch 'lh/binary'
-rw-r--r-- | ui-log.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,63 +1,68 @@ /* ui-log.c: functions for log output * * Copyright (C) 2006 Lars Hjemli * * Licensed under GNU General Public License v2 * (see COPYING for full license text) */ #include "cgit.h" #include "html.h" #include "ui-shared.h" int files, add_lines, rem_lines; void count_lines(char *line, int size) { if (size <= 0) return; if (line[0] == '+') add_lines++; else if (line[0] == '-') rem_lines++; } void inspect_files(struct diff_filepair *pair) { + unsigned long old_size = 0; + unsigned long new_size = 0; + int binary = 0; + files++; if (ctx.repo->enable_log_linecount) - cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); + cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, + &new_size, &binary, count_lines); } void show_commit_decorations(struct commit *commit) { struct name_decoration *deco; static char buf[1024]; buf[sizeof(buf) - 1] = 0; deco = lookup_decoration(&name_decoration, &commit->object); while (deco) { if (!prefixcmp(deco->name, "refs/heads/")) { strncpy(buf, deco->name + 11, sizeof(buf) - 1); cgit_log_link(buf, NULL, "branch-deco", buf, NULL, NULL, 0, NULL, NULL, ctx.qry.showmsg); } else if (!prefixcmp(deco->name, "tag: refs/tags/")) { strncpy(buf, deco->name + 15, sizeof(buf) - 1); cgit_tag_link(buf, NULL, "tag-deco", ctx.qry.head, buf); } else if (!prefixcmp(deco->name, "refs/remotes/")) { strncpy(buf, deco->name + 13, sizeof(buf) - 1); cgit_log_link(buf, NULL, "remote-deco", NULL, sha1_to_hex(commit->object.sha1), NULL, 0, NULL, NULL, ctx.qry.showmsg); } else { strncpy(buf, deco->name, sizeof(buf) - 1); cgit_commit_link(buf, NULL, "deco", ctx.qry.head, sha1_to_hex(commit->object.sha1)); } deco = deco->next; } |