]> gitweb.ps.run Git - ps-cgit/commitdiff
ui-commit: Limit diff based on path limit in qry.path
authorJohan Herland <johan@herland.net>
Wed, 9 Jun 2010 23:09:32 +0000 (01:09 +0200)
committerLars Hjemli <hjemli@gmail.com>
Sat, 19 Jun 2010 08:40:23 +0000 (10:40 +0200)
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
cmd.c
ui-commit.c
ui-commit.h

diff --git a/cmd.c b/cmd.c
index a9e426a9a223add80d990886936b5d42be8cef85..893ae2500c11be548f0bceee4c272f8c4e313644 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -51,7 +51,7 @@ static void blob_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)
index b5e3c0159ba78ec080ee3f5cde8d2253c6cd8cbf..2f4c6d4bb59039efd0012eb656ac11143102c5fc 100644 (file)
@@ -12,7 +12,7 @@
 #include "ui-diff.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 commitinfo *info;
@@ -117,7 +117,7 @@ void cgit_print_commit(char *hex)
                        tmp = sha1_to_hex(commit->parents->item->object.sha1);
                else
                        tmp = NULL;
-               cgit_print_diff(ctx.qry.sha1, tmp, NULL);
+               cgit_print_diff(ctx.qry.sha1, tmp, prefix);
        }
        cgit_free_commitinfo(info);
 }
index 40bcb311502fa9f79cf94866af0352f9c649c4ec..8198b4bacc363482df907f1974c9598eb3815fee 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef 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 */