Re: git submodules implementation question
- From
- Uma Srinivasan <usrinivasan@twitter.com>
- Date
- Aug 31, 2016, 18:58 UTC
- Message-ID
- <CAN5XQfujk2HpRGCeeGgDeeHJV3amEX=gSGva0Zot6LfEBv4CVg@mail.gmail.com>
- In-Reply-To
- <xmqqh9a022xt.fsf@gitster.mtv.corp.google.com>
> We want to affect only the process we are going to spawn to work > inside the submodule, not ourselves, which is what this call does; > this does not sound like a good idea.
Okay, in that case I would have to pass the "git_dir" as a new argument to prepare_submodule_repo_env(). I know what to pass from the is_submodule_modified() caller. I don't think it's all that obvious for the other callers.
Thanks, Uma
On Wed, Aug 31, 2016 at 11:44 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> Uma Srinivasan <usrinivasan@twitter.com> writes: > >> diff --git a/submodule.c b/submodule.c >> index 5a62aa2..23443a7 100644 >> --- a/submodule.c >> +++ b/submodule.c >> @@ -960,6 +960,9 @@ unsigned is_submodule_modified(const char *path, >> int ignore_untracked) >> return 0; >> >> } >> + /* stuff submodule git dir into env var */ >> + set_git_dir(git_dir); > > We want to affect only the process we are going to spawn to work > inside the submodule, not ourselves, which is what this call does; > this does not sound like a good idea. >