diff options
author | Johan Herland | 2010-06-10 01:09:32 +0200 |
---|---|---|
committer | Lars Hjemli | 2010-06-19 10:40:23 +0200 |
commit | ab42741c49d369e41c1e1915c6c024d79509f7d6 (patch) | |
tree | 428a18ea48b2b0c0a68f07a8a7fd7f61f590a247 | |
parent | ui-diff: Teach diffstat to obey path limit (diff) | |
download | cgit-ab42741c49d369e41c1e1915c6c024d79509f7d6.tar.gz cgit-ab42741c49d369e41c1e1915c6c024d79509f7d6.zip |
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>
-rw-r--r-- | cmd.c | 2 | ||||
-rw-r--r-- | ui-commit.c | 4 | ||||
-rw-r--r-- | ui-commit.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/cmd.c b/cmd.c index a9e426a..893ae25 100644 --- a/cmd.c +++ b/cmd.c | |||
@@ -51,7 +51,7 @@ static void blob_fn(struct cgit_context *ctx) | |||
51 | 51 | ||
52 | static void commit_fn(struct cgit_context *ctx) | 52 | static void commit_fn(struct cgit_context *ctx) |
53 | { | 53 | { |
54 | cgit_print_commit(ctx->qry.sha1); | 54 | cgit_print_commit(ctx->qry.sha1, ctx->qry.path); |
55 | } | 55 | } |
56 | 56 | ||
57 | static void diff_fn(struct cgit_context *ctx) | 57 | static void diff_fn(struct cgit_context *ctx) |
diff --git a/ui-commit.c b/ui-commit.c index b5e3c01..2f4c6d4 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include "ui-diff.h" | 12 | #include "ui-diff.h" |
13 | #include "ui-log.h" | 13 | #include "ui-log.h" |
14 | 14 | ||
15 | void cgit_print_commit(char *hex) | 15 | void cgit_print_commit(char *hex, const char *prefix) |
16 | { | 16 | { |
17 | struct commit *commit, *parent; | 17 | struct commit *commit, *parent; |
18 | struct commitinfo *info; | 18 | struct commitinfo *info; |
@@ -117,7 +117,7 @@ void cgit_print_commit(char *hex) | |||
117 | tmp = sha1_to_hex(commit->parents->item->object.sha1); | 117 | tmp = sha1_to_hex(commit->parents->item->object.sha1); |
118 | else | 118 | else |
119 | tmp = NULL; | 119 | tmp = NULL; |
120 | cgit_print_diff(ctx.qry.sha1, tmp, NULL); | 120 | cgit_print_diff(ctx.qry.sha1, tmp, prefix); |
121 | } | 121 | } |
122 | cgit_free_commitinfo(info); | 122 | cgit_free_commitinfo(info); |
123 | } | 123 | } |
diff --git a/ui-commit.h b/ui-commit.h index 40bcb31..8198b4b 100644 --- a/ui-commit.h +++ b/ui-commit.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifndef UI_COMMIT_H | 1 | #ifndef UI_COMMIT_H |
2 | #define UI_COMMIT_H | 2 | #define UI_COMMIT_H |
3 | 3 | ||
4 | extern void cgit_print_commit(char *hex); | 4 | extern void cgit_print_commit(char *hex, const char *prefix); |
5 | 5 | ||
6 | #endif /* UI_COMMIT_H */ | 6 | #endif /* UI_COMMIT_H */ |