summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--Makefile2
-rw-r--r--cgit.c3
-rw-r--r--cgit.h2
-rw-r--r--shared.c2
-rw-r--r--ui-refs.c30
5 files changed, 37 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8e3da72..36b5ff6 100644
--- a/Makefile
+++ b/Makefile
@@ -18,3 +18,3 @@ OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
ui-summary.o ui-log.o ui-tree.o ui-commit.o ui-diff.o \
- ui-snapshot.o ui-blob.o ui-tag.o
+ ui-snapshot.o ui-blob.o ui-tag.o ui-refs.o
diff --git a/cgit.c b/cgit.c
index 1b85b15..cc18ed4 100644
--- a/cgit.c
+++ b/cgit.c
@@ -105,2 +105,5 @@ static void cgit_print_repo_page(struct cacheitem *item)
break;
+ case CMD_REFS:
+ cgit_print_refs();
+ break;
case CMD_TAG:
diff --git a/cgit.h b/cgit.h
index a1fe527..d9a15f4 100644
--- a/cgit.h
+++ b/cgit.h
@@ -30,2 +30,3 @@
#define CMD_TAG 7
+#define CMD_REFS 8
@@ -262,2 +263,3 @@ extern void cgit_print_tree(const char *rev, char *path);
extern void cgit_print_commit(char *hex);
+extern void cgit_print_refs();
extern void cgit_print_tag(char *revname);
diff --git a/shared.c b/shared.c
index ff600db..7eb2b0e 100644
--- a/shared.c
+++ b/shared.c
@@ -68,3 +68,3 @@ int cgit_get_cmd_index(const char *cmd)
static char *cmds[] = {"log", "commit", "diff", "tree", "blob",
- "snapshot", "tag", NULL};
+ "snapshot", "tag", "refs", NULL};
int i;
diff --git a/ui-refs.c b/ui-refs.c
new file mode 100644
index 0000000..295f5ba
--- a/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("<table class='list nowrap'>");
+
+ 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("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
+ cgit_print_tags(0);
+ }
+
+ html("</table>");
+}