Merge branch 'fm/fetch-raw-sha1'
[gitweb.git] / environment.c
index 050f1607d531460969e2f7d49d526c4176a9679b..61c685b8d93091666891f0091d5005fe62543fc2 100644 (file)
@@ -24,6 +24,7 @@ int is_bare_repository_cfg = -1; /* unspecified */
 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;
 const char *git_commit_encoding;
 const char *git_log_output_encoding;
@@ -64,6 +65,16 @@ int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
 struct startup_info *startup_info;
 unsigned long pack_size_limit_cfg;
 
+#ifndef PROTECT_HFS_DEFAULT
+#define PROTECT_HFS_DEFAULT 0
+#endif
+int protect_hfs = PROTECT_HFS_DEFAULT;
+
+#ifndef PROTECT_NTFS_DEFAULT
+#define PROTECT_NTFS_DEFAULT 0
+#endif
+int protect_ntfs = PROTECT_NTFS_DEFAULT;
+
 /*
  * The character that begins a commented line in user-editable file
  * that is subject to stripspace.
@@ -142,6 +153,7 @@ static char *git_path_from_env(const char *envvar, const char *git_dir,
 
 static void setup_git_env(void)
 {
+       struct strbuf sb = STRBUF_INIT;
        const char *gitfile;
        const char *shallow_file;
 
@@ -150,12 +162,9 @@ static void setup_git_env(void)
                git_dir = DEFAULT_GIT_DIR_ENVIRONMENT;
        gitfile = read_gitfile(git_dir);
        git_dir = xstrdup(gitfile ? gitfile : git_dir);
-       git_common_dir = getenv(GIT_COMMON_DIR_ENVIRONMENT);
-       if (git_common_dir) {
+       if (get_common_dir(&sb, git_dir))
                git_common_dir_env = 1;
-               git_common_dir = xstrdup(git_common_dir);
-       } else
-               git_common_dir = git_dir;
+       git_common_dir = strbuf_detach(&sb, NULL);
        git_object_dir = git_path_from_env(DB_ENVIRONMENT, git_common_dir,
                                           "objects", &git_db_env);
        git_index_file = git_path_from_env(INDEX_ENVIRONMENT, git_dir,