Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 44/47] Remove all logic from get_git_work_tree()

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:17

Nguyen Thai Ngoc Duy [off-list ref] writes:
2010/12/22 Junio C Hamano [off-list ref]:
quoted
quoted
 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?
While the assertion sounds good, it does not work well. The old
function can return NULL in bare repos. is_bare_repository() and
is_inside_work_tree() expect NULL from get_git_work_tree() sometimes.
Ok, don't bother changing anything in that case---it won't help us much.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help