Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)
- From
- Brandon Williams <bmwill@google.com>
- Date
- Dec 1, 2016, 01:14 UTC
- Message-ID
- <20161201011439.GF192901@google.com>
- In-Reply-To
- <CAGZ79kaaJgsa8SsvWiGkmKQU7Wv_PD6O50ybm=rxPySk=z9N7Q@mail.gmail.com>
On 11/30, Stefan Beller wrote:
Show 12 quoted lines
> > Oh interesting, I wonder if there is a way to not have to perform a
> > chdir since taking a lock to lstat wouldn't be ideal.
>
> I think we could rewrite is_submodule_populated to be
>
> int is_submodule_populated_cheap_with_no_chdir(char *path)
> {
> return stat(path + ".git")
> }
>
> i.e. just take the presence of the .git file/dir as a hint to run
> the child process?I like this approach, its a quick (thread-safe) check to see if the submodule is interesting. If there happens to be an error with the submodule's .git file/directory then the child process will fail out.
-- Brandon Williams