]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
Add support for --scan-path command line option
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 594b95029b521c3807ddc47d0579eb0bd530877c..a792fe46eaf73d842a16dbca127ddbe6b43a96f0 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -118,6 +118,11 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.max_repo_count = atoi(value);
        else if (!strcmp(name, "max-commit-count"))
                ctx.cfg.max_commit_count = atoi(value);
+       else if (!strcmp(name, "scan-path"))
+               if (!ctx.cfg.nocache && ctx.cfg.cache_size)
+                       process_cached_repolist(value);
+               else
+                       scan_tree(value);
        else if (!strcmp(name, "source-filter"))
                ctx.cfg.source_filter = new_filter(value, 1);
        else if (!strcmp(name, "summary-log"))
@@ -140,11 +145,6 @@ void config_cb(const char *name, const char *value)
                add_mimetype(name + 9, value);
        else if (!strcmp(name, "repo.group"))
                ctx.cfg.repo_group = xstrdup(value);
-       else if (!strcmp(name, "repo.scan"))
-               if (!ctx.cfg.nocache && ctx.cfg.cache_size)
-                       process_cached_repolist(value);
-               else
-                       scan_tree(value);
        else if (!strcmp(name, "repo.url"))
                ctx.repo = cgit_add_repo(value);
        else if (!strcmp(name, "repo.name"))
@@ -547,7 +547,8 @@ static void cgit_parse_args(int argc, const char **argv)
                if (!strncmp(argv[i], "--ofs=", 6)) {
                        ctx.qry.ofs = atoi(argv[i]+6);
                }
-               if (!strncmp(argv[i], "--scan-tree=", 12)) {
+               if (!strncmp(argv[i], "--scan-tree=", 12) ||
+                   !strncmp(argv[i], "--scan-path=", 12)) {
                        scan++;
                        scan_tree(argv[i] + 12);
                }