Re: [PATCH 3/3] init: do not set core.worktree more often than necessary

2016-09-09 Thread Duy Nguyen
On Fri, Sep 9, 2016 at 2:54 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> +/* >> + * Return the first ".git" that we have encountered. >> + * FIXME this function for not entirely correct because >> + * setup_git_directory() and enter_repo() do not update first_git_dir >> + * when

Re: [PATCH 3/3] init: do not set core.worktree more often than necessary

2016-09-08 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > +/* > + * Return the first ".git" that we have encountered. > + * FIXME this function for not entirely correct because > + * setup_git_directory() and enter_repo() do not update first_git_dir > + * when they follow .git files. The function in its current state is >

[PATCH 3/3] init: do not set core.worktree more often than necessary

2016-09-08 Thread Nguyễn Thái Ngọc Duy
When "git init" is called with GIT_WORK_TREE environment set, we want to keep this worktree's location in core.worktree so the user does not have to set the environment again and again. See ef6f0af (git-init: set core.worktree if GIT_WORK_TREE is specified - 2007-07-04) We detect that by this logi