mirror of
https://git.zx2c4.com/cgit
synced 2025-06-24 18:58:39 +02:00
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>
This commit is contained in:
parent
48c487d72d
commit
42a7eb9c73
7 changed files with 31 additions and 18 deletions
|
@ -156,6 +156,9 @@ void cgit_print_commit(const char *hex)
|
|||
char *tmp;
|
||||
int i;
|
||||
|
||||
if (!hex)
|
||||
hex = cgit_query_head;
|
||||
|
||||
if (get_sha1(hex, sha1)) {
|
||||
cgit_print_error(fmt("Bad object id: %s", hex));
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue