X-Git-Url: https://git.cameronkatri.com/cgit.git/blobdiff_plain/be6991c1e42d548848bf2f51fd9910d14b5bdf40..f7f26f88755ac6a3b9af4918b51b0d6e7a692c78:/cmd.c diff --git a/cmd.c b/cmd.c index 5a3d157..420b3b1 100644 --- a/cmd.c +++ b/cmd.c @@ -1,6 +1,6 @@ /* cmd.c: the cgit command dispatcher * - * Copyright (C) 2008 Lars Hjemli + * Copyright (C) 2006-2014 cgit Development Team * * Licensed under GNU General Public License v2 * (see COPYING for full license text) @@ -46,7 +46,7 @@ static void about_fn(struct cgit_context *ctx) static void blob_fn(struct cgit_context *ctx) { - cgit_print_blob(ctx->qry.sha1, ctx->qry.path, ctx->qry.head); + cgit_print_blob(ctx->qry.sha1, ctx->qry.path, ctx->qry.head, 0); } static void commit_fn(struct cgit_context *ctx) @@ -56,7 +56,12 @@ static void commit_fn(struct cgit_context *ctx) static void diff_fn(struct cgit_context *ctx) { - cgit_print_diff(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path, 1); + cgit_print_diff(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path, 1, 0); +} + +static void rawdiff_fn(struct cgit_context *ctx) +{ + cgit_print_diff(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path, 1, 1); } static void info_fn(struct cgit_context *ctx) @@ -68,7 +73,8 @@ static void log_fn(struct cgit_context *ctx) { cgit_print_log(ctx->qry.sha1, ctx->qry.ofs, ctx->cfg.max_commit_count, ctx->qry.grep, ctx->qry.search, ctx->qry.path, 1, - ctx->repo->enable_commit_graph); + ctx->repo->enable_commit_graph, + ctx->repo->commit_sort); } static void ls_cache_fn(struct cgit_context *ctx) @@ -91,7 +97,7 @@ static void repolist_fn(struct cgit_context *ctx) static void patch_fn(struct cgit_context *ctx) { - cgit_print_patch(ctx->qry.sha1, ctx->qry.path); + cgit_print_patch(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path); } static void plain_fn(struct cgit_context *ctx) @@ -148,6 +154,7 @@ struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx) def_cmd(objects, 1, 0, 0, 1), def_cmd(patch, 1, 0, 1, 0), def_cmd(plain, 1, 0, 0, 0), + def_cmd(rawdiff, 1, 0, 1, 0), def_cmd(refs, 1, 1, 0, 0), def_cmd(repolist, 0, 0, 0, 0), def_cmd(snapshot, 1, 0, 0, 0), @@ -165,7 +172,7 @@ struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx) ctx->qry.page = "repolist"; } - for(i = 0; i < sizeof(cmds)/sizeof(*cmds); i++) + for (i = 0; i < sizeof(cmds)/sizeof(*cmds); i++) if (!strcmp(ctx->qry.page, cmds[i].name)) return &cmds[i]; return NULL;