http: treat config options sslCAPath and sslCAInfo as paths
[gitweb.git] / setup.c
diff --git a/setup.c b/setup.c
index 3324014cb7ac825fa9703cc6568190460e9cd87d..1a374f2bf4f986b00727ee04da6a65f8f914e35f 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -229,15 +229,22 @@ void verify_non_filename(const char *prefix, const char *arg)
 }
 
 int get_common_dir(struct strbuf *sb, const char *gitdir)
+{
+       const char *git_env_common_dir = getenv(GIT_COMMON_DIR_ENVIRONMENT);
+       if (git_env_common_dir) {
+               strbuf_addstr(sb, git_env_common_dir);
+               return 1;
+       } else {
+               return get_common_dir_noenv(sb, gitdir);
+       }
+}
+
+int get_common_dir_noenv(struct strbuf *sb, const char *gitdir)
 {
        struct strbuf data = STRBUF_INIT;
        struct strbuf path = STRBUF_INIT;
-       const char *git_common_dir = getenv(GIT_COMMON_DIR_ENVIRONMENT);
        int ret = 0;
-       if (git_common_dir) {
-               strbuf_addstr(sb, git_common_dir);
-               return 1;
-       }
+
        strbuf_addf(&path, "%s/commondir", gitdir);
        if (file_exists(path.buf)) {
                if (strbuf_read_file(&data, path.buf, 0) <= 0)