]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
add support for snapshot tarballs
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index b943fe5769ce56644d5b5ac54c43da0d15be8e7d..a0f88ad35515e0e3ee8c3cf2951d6915d01d8b96 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -8,9 +8,6 @@
 
 #include "cgit.h"
 
-const char cgit_version[] = CGIT_VERSION;
-
-
 static int cgit_prepare_cache(struct cacheitem *item)
 {
        if (!cgit_repo && cgit_query_repo) {
@@ -71,7 +68,7 @@ static void cgit_print_repo_page(struct cacheitem *item)
        setenv("GIT_DIR", cgit_repo->path, 1);
 
        if ((cgit_cmd == CMD_SNAPSHOT) && cgit_repo->snapshots) {
-               cgit_print_snapshot(item, cgit_query_sha1, "zip",
+               cgit_print_snapshot(item, cgit_query_sha1,
                                    cgit_repo->url, cgit_query_name);
                return;
        }
@@ -225,6 +222,7 @@ static void cgit_parse_args(int argc, const char **argv)
 int main(int argc, const char **argv)
 {
        struct cacheitem item;
+       const char *cgit_config_env = getenv("CGIT_CONFIG");
 
        htmlfd = STDOUT_FILENO;
        item.st.st_mtime = time(NULL);
@@ -232,7 +230,8 @@ int main(int argc, const char **argv)
        cgit_repolist.count = 0;
        cgit_repolist.repos = NULL;
 
-       cgit_read_config(CGIT_CONFIG, cgit_global_config_cb);
+       cgit_read_config(cgit_config_env ? cgit_config_env : CGIT_CONFIG,
+                        cgit_global_config_cb);
        cgit_repo = NULL;
        if (getenv("SCRIPT_NAME"))
                cgit_script_name = xstrdup(getenv("SCRIPT_NAME"));