Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-06-22 21:43:34 +0300
committerJunio C Hamano <gitster@pobox.com>2017-06-24 04:24:34 +0300
commitb4158732827af925592fc074ea5d0fe7b485e547 (patch)
tree0f1ac0fac53282106db8102dd90c1b20dcdad6ea /environment.c
parentc14c234f22e0656a61f5718baf155118e6e609c9 (diff)
environment: store worktree in the_repository
Migrate 'work_tree' to be stored in 'the_repository'. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/environment.c b/environment.c
index aa79ef83e4..3fd4b10845 100644
--- a/environment.c
+++ b/environment.c
@@ -96,7 +96,6 @@ int ignore_untracked_cache_config;
/* This is set by setup_git_dir_gently() and/or git_default_config() */
char *git_work_tree_cfg;
-static char *work_tree;
static const char *namespace;
@@ -223,19 +222,19 @@ void set_git_work_tree(const char *new_work_tree)
{
if (git_work_tree_initialized) {
new_work_tree = real_path(new_work_tree);
- if (strcmp(new_work_tree, work_tree))
+ if (strcmp(new_work_tree, the_repository->worktree))
die("internal error: work tree has already been set\n"
"Current worktree: %s\nNew worktree: %s",
- work_tree, new_work_tree);
+ the_repository->worktree, new_work_tree);
return;
}
git_work_tree_initialized = 1;
- work_tree = real_pathdup(new_work_tree, 1);
+ repo_set_worktree(the_repository, new_work_tree);
}
const char *get_git_work_tree(void)
{
- return work_tree;
+ return the_repository->worktree;
}
char *get_object_directory(void)