diff options
author | Lars Hjemli <hjemli@gmail.com> | 2007-02-08 21:53:13 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-02-08 21:58:58 (JST) |
commit | ab2ab95f09994560f62fd631f07d3b6e3577aa6e (patch) | |
tree | 846763c1bcb78bd27dc37c99e5f6d703ca5ab179 /shared.c | |
parent | 14d360df60f059b9b5b045fc6df1eec6f0966d9a (diff) | |
download | cgit-ab2ab95f09994560f62fd631f07d3b6e3577aa6e.zip cgit-ab2ab95f09994560f62fd631f07d3b6e3577aa6e.tar.gz |
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>
Diffstat (limited to 'shared.c')
-rw-r--r-- | shared.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -44,10 +44,25 @@ char *cgit_query_search = NULL; | |||
44 | char *cgit_query_sha1 = NULL; | 44 | char *cgit_query_sha1 = NULL; |
45 | char *cgit_query_sha2 = NULL; | 45 | char *cgit_query_sha2 = NULL; |
46 | char *cgit_query_path = NULL; | 46 | char *cgit_query_path = NULL; |
47 | char *cgit_query_name = NULL; | ||
47 | int cgit_query_ofs = 0; | 48 | int cgit_query_ofs = 0; |
48 | 49 | ||
49 | int htmlfd = 0; | 50 | int htmlfd = 0; |
50 | 51 | ||
52 | int chk_zero(int result, char *msg) | ||
53 | { | ||
54 | if (result != 0) | ||
55 | die("%s: %s", msg, strerror(errno)); | ||
56 | return result; | ||
57 | } | ||
58 | |||
59 | int chk_positive(int result, char *msg) | ||
60 | { | ||
61 | if (result <= 0) | ||
62 | die("%s: %s", msg, strerror(errno)); | ||
63 | return result; | ||
64 | } | ||
65 | |||
51 | struct repoinfo *add_repo(const char *url) | 66 | struct repoinfo *add_repo(const char *url) |
52 | { | 67 | { |
53 | struct repoinfo *ret; | 68 | struct repoinfo *ret; |
@@ -140,6 +155,8 @@ void cgit_querystring_cb(const char *name, const char *value) | |||
140 | cgit_query_ofs = atoi(value); | 155 | cgit_query_ofs = atoi(value); |
141 | } else if (!strcmp(name, "path")) { | 156 | } else if (!strcmp(name, "path")) { |
142 | cgit_query_path = xstrdup(value); | 157 | cgit_query_path = xstrdup(value); |
158 | } else if (!strcmp(name, "name")) { | ||
159 | cgit_query_name = xstrdup(value); | ||
143 | } | 160 | } |
144 | } | 161 | } |
145 | 162 | ||