summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-06-18 20:19:09 -0700
committerJunio C Hamano <junkio@cox.net>2006-06-18 20:19:09 -0700
commitd9faecac641ab31c7bfe5008f5a6dca119b79bc7 (patch)
treee132b0d810e00c6ea2bb4ea5c8a4597ff4cb0e2a /setup.c
parent72afd3eea6758a5ef181eaa3eef0b21639177494 (diff)
parent94df2506edd76a886a1044376f8c99349b2f226e (diff)
downloadgit-d9faecac641ab31c7bfe5008f5a6dca119b79bc7.tar.gz
Merge branch 'jc/shared'
* jc/shared: shared repository: optionally allow reading to "others".
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index fe7f884696..4612f110ee 100644
--- a/setup.c
+++ b/setup.c
@@ -219,12 +219,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;
}