setup: drop repository_format_version global
[gitweb.git] / environment.c
index b42e2384348523749f5cea8c85f7601ef4a92199..d9e3861fe8f1f93cf2b34235dd9eaf9d8bd8847a 100644 (file)
@@ -25,7 +25,6 @@ int log_all_ref_updates = -1; /* unspecified */
 int warn_ambiguous_refs = 1;
 int warn_on_object_refname_ambiguity = 1;
 int ref_paranoia = -1;
-int repository_format_version;
 int repository_format_precious_objects;
 const char *git_commit_encoding;
 const char *git_log_output_encoding;
@@ -326,13 +325,22 @@ const char *get_commit_output_encoding(void)
 }
 
 static int the_shared_repository = PERM_UMASK;
+static int need_shared_repository_from_config = 1;
 
 void set_shared_repository(int value)
 {
        the_shared_repository = value;
+       need_shared_repository_from_config = 0;
 }
 
 int get_shared_repository(void)
 {
+       if (need_shared_repository_from_config) {
+               const char *var = "core.sharedrepository";
+               const char *value;
+               if (!git_config_get_value(var, &value))
+                       the_shared_repository = git_config_perm(var, value);
+               need_shared_repository_from_config = 0;
+       }
        return the_shared_repository;
 }