author | Lars Hjemli <hjemli@gmail.com> | 2008-02-16 12:56:09 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-02-16 12:56:09 (UTC) |
commit | d1f3bbe9d22029f45a77bb938c176ccc0c827d46 (patch) (side-by-side diff) | |
tree | 3f1741c012763cbc5485f31377abdd9241fbac6b /ui-log.c | |
parent | b228d4ff82a65fdcd4a7364759fe36a0bdda5978 (diff) | |
download | cgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.zip cgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.tar.gz cgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.tar.bz2 |
Move cgit_repo into cgit_context
This removes the global variable which is used to keep track of the
currently selected repository, and adds a new variable in the cgit_context
structure.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-log.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -20,38 +20,38 @@ void count_lines(char *line, int size) else if (line[0] == '-') rem_lines++; } void inspect_files(struct diff_filepair *pair) { files++; - if (cgit_repo->enable_log_linecount) + if (ctx.repo->enable_log_linecount) cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); } void print_commit(struct commit *commit) { struct commitinfo *info; info = cgit_parse_commit(commit); html("<tr><td>"); cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); html("</td><td>"); cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, sha1_to_hex(commit->object.sha1)); - if (cgit_repo->enable_log_filecount) { + if (ctx.repo->enable_log_filecount) { files = 0; add_lines = 0; rem_lines = 0; cgit_diff_commit(commit, inspect_files); html("</td><td class='right'>"); htmlf("%d", files); - if (cgit_repo->enable_log_linecount) { + if (ctx.repo->enable_log_linecount) { html("</td><td class='right'>"); htmlf("-%d/+%d", rem_lines, add_lines); } } html("</td><td>"); html_txt(info->author); html("</td></tr>\n"); cgit_free_commitinfo(info); @@ -89,19 +89,19 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern compile_grep_patterns(rev.grep_filter); } prepare_revision_walk(&rev); html("<table summary='log' class='list nowrap'>"); html("<tr class='nohover'><th class='left'>Age</th>" "<th class='left'>Message</th>"); - if (cgit_repo->enable_log_filecount) { + if (ctx.repo->enable_log_filecount) { html("<th class='right'>Files</th>"); - if (cgit_repo->enable_log_linecount) + if (ctx.repo->enable_log_linecount) html("<th class='right'>Lines</th>"); } html("<th class='left'>Author</th></tr>\n"); if (ofs<0) ofs = 0; for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |