Nguyễn Thái Ngọc Duy [off-list ref] writes:
quoted hunk ↗ jump to hunk
This logic is now only used by cmd_init_db(). setup_* functions do not
rely on it any more. Move all the logic to cmd_init_db() and turn
get_git_work_tree() into a simple function.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
diff --git a/environment.c b/environment.c
index d811049..149c132 100644
--- a/environment.c
+++ b/environment.c
@@ -137,36 +137,20 @@ static int git_work_tree_initialized;
*/
...
const char *get_git_work_tree(void)
{
- if (startup_info && !startup_info->setup_explicit) {
-...
- }
return work_tree;
}
Would it be a bug in the new set-up code if this function gets called and
work_tree is still NULL?
There are quite a few callers that call get_git_work_tree() and expect
that it will always return a non NULL pointer. Perhaps we would want an
assertion here?