diff options
Diffstat (limited to 'ui-log.c')
-rw-r--r-- | ui-log.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -285,18 +285,24 @@ static char *next_token(char **src) return result; } -void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, - char *path, int pager, int commit_graph, int commit_sort) +void cgit_print_log(const char *tip, const char *from, int ofs, int cnt, + char *grep, char *pattern, char *path, int pager, + int commit_graph, int commit_sort) { struct rev_info rev; struct commit *commit; struct argv_array rev_argv = ARGV_ARRAY_INIT; int i, columns = commit_graph ? 4 : 3; - int must_free_tip = 0; + int must_free_tip = 0, must_free_from = 0; /* rev_argv.argv[0] will be ignored by setup_revisions */ argv_array_push(&rev_argv, "log_rev_setup"); + if (from) { + from = disambiguate_ref(from, &must_free_from); + argv_array_pushf(&rev_argv, "^%s", from); + } + if (!tip) tip = ctx.qry.head; tip = disambiguate_ref(tip, &must_free_tip); @@ -430,4 +436,6 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern /* If we allocated tip then it is safe to cast away const. */ if (must_free_tip) free((char*) tip); + if (must_free_from) + free((char*) from); } |