ui-commit: Limit diff based on path limit in qry.path

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
这个提交包含在:
Johan Herland 2010-06-10 01:09:32 +02:00 提交者 Lars Hjemli
父节点 c46e468dd2
当前提交 ab42741c49
共有 3 个文件被更改,包括 4 次插入4 次删除

2
cmd.c
查看文件

@ -51,7 +51,7 @@ static void blob_fn(struct cgit_context *ctx)
static void commit_fn(struct cgit_context *ctx) static void commit_fn(struct cgit_context *ctx)
{ {
cgit_print_commit(ctx->qry.sha1); cgit_print_commit(ctx->qry.sha1, ctx->qry.path);
} }
static void diff_fn(struct cgit_context *ctx) static void diff_fn(struct cgit_context *ctx)

查看文件

@ -12,7 +12,7 @@
#include "ui-diff.h" #include "ui-diff.h"
#include "ui-log.h" #include "ui-log.h"
void cgit_print_commit(char *hex) void cgit_print_commit(char *hex, const char *prefix)
{ {
struct commit *commit, *parent; struct commit *commit, *parent;
struct commitinfo *info; struct commitinfo *info;
@ -117,7 +117,7 @@ void cgit_print_commit(char *hex)
tmp = sha1_to_hex(commit->parents->item->object.sha1); tmp = sha1_to_hex(commit->parents->item->object.sha1);
else else
tmp = NULL; tmp = NULL;
cgit_print_diff(ctx.qry.sha1, tmp, NULL); cgit_print_diff(ctx.qry.sha1, tmp, prefix);
} }
cgit_free_commitinfo(info); cgit_free_commitinfo(info);
} }

查看文件

@ -1,6 +1,6 @@
#ifndef UI_COMMIT_H #ifndef UI_COMMIT_H
#define UI_COMMIT_H #define UI_COMMIT_H
extern void cgit_print_commit(char *hex); extern void cgit_print_commit(char *hex, const char *prefix);
#endif /* UI_COMMIT_H */ #endif /* UI_COMMIT_H */