]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
cgit.c: respect repo-local 'snapshots' option for --scan-path
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 838163084e91795816184f150fbcea310d0bfb90..3fcca2a2d3f31ec2ae955357018f13e775bc3bbe 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -620,6 +620,16 @@ static void cgit_parse_args(int argc, const char **argv)
                }
                if (!strncmp(argv[i], "--scan-tree=", 12) ||
                    !strncmp(argv[i], "--scan-path=", 12)) {
+                       /* HACK: the global snapshot bitmask defines the
+                        * set of allowed snapshot formats, but the config
+                        * file hasn't been parsed yet so the mask is
+                        * currently 0. By setting all bits high before
+                        * scanning we make sure that any in-repo cgitrc
+                        * snapshot setting is respected by scan_tree().
+                        * BTW: we assume that there'll never be more than
+                        * 255 different snapshot formats supported by cgit...
+                        */
+                       ctx.cfg.snapshots = 0xFF;
                        scan++;
                        scan_tree(argv[i] + 12, repo_config);
                }