|
diff --git a/ui-log.c b/ui-log.c index 72e2a4b..e1d324d 100644 --- a/ ui-log.c+++ b/ ui-log.c |
|
@@ -1,41 +1,42 @@ |
1 | /* ui-log.c: functions for log output |
1 | /* ui-log.c: functions for log output |
2 | * |
2 | * |
3 | * Copyright (C) 2006 Lars Hjemli |
3 | * Copyright (C) 2006 Lars Hjemli |
4 | * |
4 | * |
5 | * Licensed under GNU General Public License v2 |
5 | * Licensed under GNU General Public License v2 |
6 | * (see COPYING for full license text) |
6 | * (see COPYING for full license text) |
7 | */ |
7 | */ |
8 | |
8 | |
9 | #include "cgit.h" |
9 | #include "cgit.h" |
| |
10 | #include "html.h" |
10 | |
11 | |
11 | int files, add_lines, rem_lines; |
12 | int files, add_lines, rem_lines; |
12 | |
13 | |
13 | void count_lines(char *line, int size) |
14 | void count_lines(char *line, int size) |
14 | { |
15 | { |
15 | if (size <= 0) |
16 | if (size <= 0) |
16 | return; |
17 | return; |
17 | |
18 | |
18 | if (line[0] == '+') |
19 | if (line[0] == '+') |
19 | add_lines++; |
20 | add_lines++; |
20 | |
21 | |
21 | else if (line[0] == '-') |
22 | else if (line[0] == '-') |
22 | rem_lines++; |
23 | rem_lines++; |
23 | } |
24 | } |
24 | |
25 | |
25 | void inspect_files(struct diff_filepair *pair) |
26 | void inspect_files(struct diff_filepair *pair) |
26 | { |
27 | { |
27 | files++; |
28 | files++; |
28 | if (ctx.repo->enable_log_linecount) |
29 | if (ctx.repo->enable_log_linecount) |
29 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
30 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
30 | } |
31 | } |
31 | |
32 | |
32 | void print_commit(struct commit *commit) |
33 | void print_commit(struct commit *commit) |
33 | { |
34 | { |
34 | struct commitinfo *info; |
35 | struct commitinfo *info; |
35 | |
36 | |
36 | info = cgit_parse_commit(commit); |
37 | info = cgit_parse_commit(commit); |
37 | html("<tr><td>"); |
38 | html("<tr><td>"); |
38 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
39 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
39 | html("</td><td>"); |
40 | html("</td><td>"); |
40 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
41 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
41 | sha1_to_hex(commit->object.sha1)); |
42 | sha1_to_hex(commit->object.sha1)); |
|