Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx> writes: > 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 <pclouds@xxxxxxxxx> > Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx> > --- > 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? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html