]> git.ipfire.org Git - thirdparty/git.git/blobdiff - environment.c
blame.c: replace instance of !oidcmp for oideq
[thirdparty/git.git] / environment.c
index 9f5f3811dbeefe64864f54779903376c52857fef..10c9061c432cf9d82e0fbd14fed7c4a9a304c447 100644 (file)
@@ -31,8 +31,6 @@ int warn_ambiguous_refs = 1;
 int warn_on_object_refname_ambiguity = 1;
 int ref_paranoia = -1;
 int repository_format_precious_objects;
-char *repository_format_partial_clone;
-const char *core_partial_clone_filter_default;
 int repository_format_worktree_config;
 const char *git_commit_encoding;
 const char *git_log_output_encoding;
@@ -69,6 +67,7 @@ enum object_creation_mode object_creation_mode = OBJECT_CREATION_MODE;
 char *notes_ref_name;
 int grafts_replace_parents = 1;
 int core_apply_sparse_checkout;
+int core_sparse_checkout_cone;
 int merge_log_config = -1;
 int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
 unsigned long pack_size_limit_cfg;
@@ -255,8 +254,11 @@ static int git_work_tree_initialized;
  */
 void set_git_work_tree(const char *new_work_tree)
 {
+       struct strbuf realpath = STRBUF_INIT;
+
        if (git_work_tree_initialized) {
-               new_work_tree = real_path(new_work_tree);
+               strbuf_realpath(&realpath, new_work_tree, 1);
+               new_work_tree = realpath.buf;
                if (strcmp(new_work_tree, the_repository->worktree))
                        die("internal error: work tree has already been set\n"
                            "Current worktree: %s\nNew worktree: %s",
@@ -265,6 +267,8 @@ void set_git_work_tree(const char *new_work_tree)
        }
        git_work_tree_initialized = 1;
        repo_set_worktree(the_repository, new_work_tree);
+
+       strbuf_release(&realpath);
 }
 
 const char *get_git_work_tree(void)
@@ -346,11 +350,20 @@ static void update_relative_gitdir(const char *name,
        free(path);
 }
 
-void set_git_dir(const char *path)
+void set_git_dir(const char *path, int make_realpath)
 {
+       struct strbuf realpath = STRBUF_INIT;
+
+       if (make_realpath) {
+               strbuf_realpath(&realpath, path, 1);
+               path = realpath.buf;
+       }
+
        set_git_dir_1(path);
        if (!is_absolute_path(path))
                chdir_notify_register(NULL, update_relative_gitdir, NULL);
+
+       strbuf_release(&realpath);
 }
 
 const char *get_log_output_encoding(void)