aboutsummaryrefslogtreecommitdiffstats
path: root/ui-commit.c
diff options
context:
space:
mode:
authorLars Hjemli2007-06-17 14:53:02 +0200
committerLars Hjemli2007-06-17 14:53:02 +0200
commit42a7eb9c73457319a3fd5441ff26046fc9b31dad (patch)
tree4771b955e031005e7c222ef0cbabb719f7cd003a /ui-commit.c
parent48c487d72daef7e71683a85f775db8d36ab20341 (diff)
downloadcgit-42a7eb9c73457319a3fd5441ff26046fc9b31dad.tar.gz
cgit-42a7eb9c73457319a3fd5441ff26046fc9b31dad.tar.bz2
cgit-42a7eb9c73457319a3fd5441ff26046fc9b31dad.zip
Add cgit_commit_link() + support for id=sha1 to commit view
This adds a function to generate links to the commit page and extends said page to use id from querystring as primary revision specified (fallback to h). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-commit.c')
-rw-r--r--ui-commit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui-commit.c b/ui-commit.c
index 885f870..8864fc6 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -156,6 +156,9 @@ void cgit_print_commit(const char *hex)
156 char *tmp; 156 char *tmp;
157 int i; 157 int i;
158 158
159 if (!hex)
160 hex = cgit_query_head;
161
159 if (get_sha1(hex, sha1)) { 162 if (get_sha1(hex, sha1)) {
160 cgit_print_error(fmt("Bad object id: %s", hex)); 163 cgit_print_error(fmt("Bad object id: %s", hex));
161 return; 164 return;