aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
authorGravatar Lars Hjemli <hjemli@gmail.com>2007-07-23 06:57:48 (JST)
committerGravatar Lars Hjemli <hjemli@gmail.com>2007-07-23 06:57:56 (JST)
commit1d4aaff696ee1b9085dda0f0f3d84d9d20d96db0 (patch)
tree6674c5168d967c3efdbf8f445e7e975d54e43629 /shared.c
parent4e9107abfe8d3edff17826875b417bcf40dc7390 (diff)
parentd6b01dac856efda565d4085e77826fd9ac83348a (diff)
downloadcgit-1d4aaff696ee1b9085dda0f0f3d84d9d20d96db0.zip
cgit-1d4aaff696ee1b9085dda0f0f3d84d9d20d96db0.tar.gz
Merge branch 'master' of git://git.klever.net/patchwork/cgit
* 'master' of git://git.klever.net/patchwork/cgit: link raw blob from tree file view fix: changed view link to blob in summary. allow selective enabling of snapshots shorten snapshot names to repo basename introduce cgit_repobasename added snapshot filename to the link add plain uncompressed tar snapshort format introduced .tar.bz2 snapshots compress .tar.gz using gzip as a filter added a chk_non_negative check css: adjust vertical-align of commit info th cells add support for snapshot tarballs Conflicts: ui-summary.c Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/shared.c b/shared.c
index 06693b0..077934f 100644
--- a/shared.c
+++ b/shared.c
@@ -86,6 +86,13 @@ int chk_positive(int result, char *msg)
86 return result; 86 return result;
87} 87}
88 88
89int chk_non_negative(int result, char *msg)
90{
91 if (result < 0)
92 die("%s: %s",msg, strerror(errno));
93 return result;
94}
95
89struct repoinfo *add_repo(const char *url) 96struct repoinfo *add_repo(const char *url)
90{ 97{
91 struct repoinfo *ret; 98 struct repoinfo *ret;
@@ -148,7 +155,7 @@ void cgit_global_config_cb(const char *name, const char *value)
148 else if (!strcmp(name, "nocache")) 155 else if (!strcmp(name, "nocache"))
149 cgit_nocache = atoi(value); 156 cgit_nocache = atoi(value);
150 else if (!strcmp(name, "snapshots")) 157 else if (!strcmp(name, "snapshots"))
151 cgit_snapshots = atoi(value); 158 cgit_snapshots = cgit_parse_snapshots_mask(value);
152 else if (!strcmp(name, "enable-index-links")) 159 else if (!strcmp(name, "enable-index-links"))
153 cgit_enable_index_links = atoi(value); 160 cgit_enable_index_links = atoi(value);
154 else if (!strcmp(name, "enable-log-filecount")) 161 else if (!strcmp(name, "enable-log-filecount"))
@@ -190,7 +197,7 @@ void cgit_global_config_cb(const char *name, const char *value)
190 else if (cgit_repo && !strcmp(name, "repo.defbranch")) 197 else if (cgit_repo && !strcmp(name, "repo.defbranch"))
191 cgit_repo->defbranch = xstrdup(value); 198 cgit_repo->defbranch = xstrdup(value);
192 else if (cgit_repo && !strcmp(name, "repo.snapshots")) 199 else if (cgit_repo && !strcmp(name, "repo.snapshots"))
193 cgit_repo->snapshots = cgit_snapshots * atoi(value); 200 cgit_repo->snapshots = cgit_snapshots & cgit_parse_snapshots_mask(value); /* XXX: &? */
194 else if (cgit_repo && !strcmp(name, "repo.enable-log-filecount")) 201 else if (cgit_repo && !strcmp(name, "repo.enable-log-filecount"))
195 cgit_repo->enable_log_filecount = cgit_enable_log_filecount * atoi(value); 202 cgit_repo->enable_log_filecount = cgit_enable_log_filecount * atoi(value);
196 else if (cgit_repo && !strcmp(name, "repo.enable-log-linecount")) 203 else if (cgit_repo && !strcmp(name, "repo.enable-log-linecount"))