On Fri, Sep 9, 2016 at 2:54 AM, Junio C Hamano <gits...@pobox.com> wrote:
> Nguyễn Thái Ngọc Duy <pclo...@gmail.com> 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
>> + * only suitable for "git init".
>> + */
> Would it be possible to move this to "init-db.c" then?
> The very first thing cmd_init_db() does to what is in the
> environment.c is to call set_git_dir() via set_git_dir_init() to
> tell it where the ".git" thing is, no? Can't that code remember the
> location itself, instead of adding code that is known not to be
> usable by other callers? That would help avoiding the future
Good idea. I was fixated on read_gitfile()m it didn't occur to me.