Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
environment: store worktree in the_repository
author
Brandon Williams
<bmwill@google.com>
Thu, 22 Jun 2017 18:43:34 +0000
(11:43 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 24 Jun 2017 01:24:34 +0000
(18:24 -0700)
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>
environment.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c14c234
)
diff --git
a/environment.c
b/environment.c
index aa79ef83e469435be26a2838f61c179e93c77a47..3fd4b1084590d0118cad5e7ae32fb37e570e7523 100644
(file)
--- 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;
/* 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;
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 (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->work
tree))
die("internal error: work tree has already been set\n"
"Current worktree: %s\nNew worktree: %s",
die("internal error: work tree has already been set\n"
"Current worktree: %s\nNew worktree: %s",
-
work_
tree, new_work_tree);
+
the_repository->work
tree, new_work_tree);
return;
}
git_work_tree_initialized = 1;
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)
{
}
const char *get_git_work_tree(void)
{
- return
work_
tree;
+ return
the_repository->work
tree;
}
char *get_object_directory(void)
}
char *get_object_directory(void)