]> git.ipfire.org Git - thirdparty/git.git/blobdiff - environment.c
l10n: zh_CN v2.38.0 rounds 1 & 2
[thirdparty/git.git] / environment.c
index b3296ce7d15140bff12299b25d1450f69f8508ee..18d042b467d26a9cb3b228db1ef5afa2d903e72c 100644 (file)
@@ -56,7 +56,6 @@ const char *askpass_program;
 const char *excludes_file;
 enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
 int read_replace_refs = 1;
-char *git_replace_ref_base;
 enum eol core_eol = EOL_UNSET;
 int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
 char *check_roundtrip_encoding = "SHIFT-JIS";
@@ -162,6 +161,7 @@ const char *getenv_safe(struct strvec *argv, const char *name)
 
 void setup_git_env(const char *git_dir)
 {
+       char *git_replace_ref_base;
        const char *shallow_file;
        const char *replace_ref_base;
        struct set_gitdir_args args = { NULL };
@@ -182,9 +182,10 @@ void setup_git_env(const char *git_dir)
        if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))
                read_replace_refs = 0;
        replace_ref_base = getenv(GIT_REPLACE_REF_BASE_ENVIRONMENT);
-       free(git_replace_ref_base);
        git_replace_ref_base = xstrdup(replace_ref_base ? replace_ref_base
                                                          : "refs/replace/");
+       update_ref_namespace(NAMESPACE_REPLACE, git_replace_ref_base);
+
        free(git_namespace);
        git_namespace = expand_namespace(getenv(GIT_NAMESPACE_ENVIRONMENT));
        shallow_file = getenv(GIT_SHALLOW_FILE_ENVIRONMENT);
@@ -333,10 +334,10 @@ static void set_git_dir_1(const char *path)
        setup_git_env(path);
 }
 
-static void update_relative_gitdir(const char *name,
+static void update_relative_gitdir(const char *name UNUSED,
                                   const char *old_cwd,
                                   const char *new_cwd,
-                                  void *data)
+                                  void *data UNUSED)
 {
        char *path = reparent_relative_path(old_cwd, new_cwd, get_git_dir());
        struct tmp_objdir *tmp_objdir = tmp_objdir_unapply_primary_odb();