mirror of
https://git.zx2c4.com/cgit
synced 2025-08-31 15:09:42 +02:00
Add support for snapshots
Make a link from the commit viewer to a snapshot of the corresponding tree. Currently only zip-format is supported. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
parent
14d360df60
commit
ab2ab95f09
8 changed files with 153 additions and 8 deletions
17
shared.c
17
shared.c
|
@ -44,10 +44,25 @@ char *cgit_query_search = NULL;
|
|||
char *cgit_query_sha1 = NULL;
|
||||
char *cgit_query_sha2 = NULL;
|
||||
char *cgit_query_path = NULL;
|
||||
char *cgit_query_name = NULL;
|
||||
int cgit_query_ofs = 0;
|
||||
|
||||
int htmlfd = 0;
|
||||
|
||||
int chk_zero(int result, char *msg)
|
||||
{
|
||||
if (result != 0)
|
||||
die("%s: %s", msg, strerror(errno));
|
||||
return result;
|
||||
}
|
||||
|
||||
int chk_positive(int result, char *msg)
|
||||
{
|
||||
if (result <= 0)
|
||||
die("%s: %s", msg, strerror(errno));
|
||||
return result;
|
||||
}
|
||||
|
||||
struct repoinfo *add_repo(const char *url)
|
||||
{
|
||||
struct repoinfo *ret;
|
||||
|
@ -140,6 +155,8 @@ void cgit_querystring_cb(const char *name, const char *value)
|
|||
cgit_query_ofs = atoi(value);
|
||||
} else if (!strcmp(name, "path")) {
|
||||
cgit_query_path = xstrdup(value);
|
||||
} else if (!strcmp(name, "name")) {
|
||||
cgit_query_name = xstrdup(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue