Re: git submodules implementation question
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Aug 30, 2016, 00:02 UTC
- Message-ID
- <CA+P7+xosGg955msq-gyKz_HyCZf7fPFQJdKZ3P8U3+poBBfuWA@mail.gmail.com>
- In-Reply-To
- <xmqqbn0b6ua8.fsf@gitster.mtv.corp.google.com>
On Mon, Aug 29, 2016 at 4:15 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> Uma Srinivasan <usrinivasan@twitter.com> writes: >> This fixes my issue but what do you think? Is this the right way to >> fix it? Is there a better way? > > I think we already have a helper function that does a lot better > than "does it have a file called HEAD" to ask "is this a git > directory?" and its name I think is "is_git_directory" (I know, we > are not imaginative when naming our functions). > > As to the check makes sense in the context of this function, I am > not an expert to judge. I'd expect Jens, Heiko and/or Stefan to > know better than I do.
One of my patches adds a "is_git_directory()" call to this, and if we fail falls back to checking the .gitmodules and git-config for information regarding the submodule should it no longer be checked out. I suspect this patch will address your concern.
Thanks, Jake