gitweb: Use rev-list pattern search options.
[gitweb.git] / setup.c
diff --git a/setup.c b/setup.c
index fe7f8846962d1c656d258384dbfa466031e28896..2afdba414a073705440f887593a1b5daa1023758 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -184,6 +184,10 @@ const char *setup_git_directory_gently(int *nongit_ok)
                }
                return NULL;
        bad_dir_environ:
+               if (nongit_ok) {
+                       *nongit_ok = 1;
+                       return NULL;
+               }
                path[len] = 0;
                die("Not a git repository: '%s'", path);
        }
@@ -219,12 +223,27 @@ const char *setup_git_directory_gently(int *nongit_ok)
        return cwd + offset;
 }
 
+int git_config_perm(const char *var, const char *value)
+{
+       if (value) {
+               if (!strcmp(value, "umask"))
+                       return PERM_UMASK;
+               if (!strcmp(value, "group"))
+                       return PERM_GROUP;
+               if (!strcmp(value, "all") ||
+                   !strcmp(value, "world") ||
+                   !strcmp(value, "everybody"))
+                       return PERM_EVERYBODY;
+       }
+       return git_config_bool(var, value);
+}
+
 int check_repository_format_version(const char *var, const char *value)
 {
        if (strcmp(var, "core.repositoryformatversion") == 0)
                repository_format_version = git_config_int(var, value);
        else if (strcmp(var, "core.sharedrepository") == 0)
-               shared_repository = git_config_bool(var, value);
+               shared_repository = git_config_perm(var, value);
        return 0;
 }