From 7937d06090dd5e19145ec6fa8befc5770954b30c Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sat, 27 Oct 2007 10:36:53 +0200 Subject: Add support for refs view This enables the new urls $repo/refs, $repo/refs/heads and $repo/refs/tags, which can be used to print _all_ branches and/or tags. Signed-off-by: Lars Hjemli --- ui-refs.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ui-refs.c (limited to 'ui-refs.c') diff --git a/ui-refs.c b/ui-refs.c new file mode 100644 index 0000000..295f5ba --- /dev/null +++ b/ui-refs.c @@ -0,0 +1,30 @@ +/* ui-refs.c: browse symbolic refs + * + * Copyright (C) 2006 Lars Hjemli + * + * Licensed under GNU General Public License v2 + * (see COPYING for full license text) + */ + +#include "cgit.h" + + + + +void cgit_print_refs() +{ + + html(""); + + if (cgit_query_path && !strncmp(cgit_query_path, "heads", 5)) + cgit_print_branches(0); + else if (cgit_query_path && !strncmp(cgit_query_path, "tags", 4)) + cgit_print_tags(0); + else { + cgit_print_branches(0); + html(""); + cgit_print_tags(0); + } + + html("
 
"); +} -- cgit v1.2.3-24-g4f1b