[CGit] [PATCH 4/6] source_filter: also communicate the repo name to the filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ferry Huberts <ferry.huberts@xxxxxxxxxx>

Signed-off-by: Ferry Huberts <ferry.huberts@xxxxxxxxxx>
---
 cgit.c                         |    2 +-
 filters/syntax-highlighting.sh |    1 +
 ui-tree.c                      |    2 ++
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/cgit.c b/cgit.c
index 6fa8f60..65c892c 100644
--- a/cgit.c
+++ b/cgit.c
@@ -46,7 +46,7 @@ struct cgit_filter *new_filter(const char *cmd, filter_type filtertype)
 			break;
 
 		case source:
-			extra_args = 1;
+			extra_args = 2;
 			break;
 
 		default:
diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
index 6b1c576..80d670f 100755
--- a/filters/syntax-highlighting.sh
+++ b/filters/syntax-highlighting.sh
@@ -26,6 +26,7 @@
 
 # store filename and extension in local vars
 BASENAME="$1"
+REPONAME="$2"
 EXTENSION="${BASENAME##*.}"
 
 # map Makefile and Makefile.* to .mk
diff --git a/ui-tree.c b/ui-tree.c
index 442b6be..2c7298c 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -45,6 +45,8 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size)
 	if (ctx.repo->source_filter) {
 		html("<td class='lines'><pre><code>");
 		ctx.repo->source_filter->argv[1] = xstrdup(name);
+		if (!ctx.repo->source_filter->argv[2])
+			ctx.repo->source_filter->argv[2] = xstrdup(ctx.repo->name);
 		cgit_open_filter(ctx.repo->source_filter);
 		html_raw(buf, size);
 		cgit_close_filter(ctx.repo->source_filter);
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]