Re: [PATCH v2 2/3] init: do not set core.worktree more often than necessary
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 22, 2016, 17:27 UTC
- Message-ID
- <xmqqbmzf6e0r.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CACsJy8BQvo_XSXZ3m8=A=0tik3qPd8k9cyC4G408JK+AhtYStQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 9 quoted lines
>> Perhaps a comment before init_db() to tell callers to always call >> the other one is the least thing necessary? > > Good thinking. We could go a step further, baking it as assert() to > catch new/incorrect call sequences automatically. > > Or we could combine the two functions init_db() and set_git_dir_init() > into one. I prefer this one, but having problem with finding a good > name for it ...
It probably is a reasonable way forward to name the combined function that takes the parameters that are taken by both functions in their current incarnation init_db(). After all, initializing the Git repository database involves telling the function where the .git directory is, among other things like where to take the template for a newly created repository is.