Re: [PATCH] setup.c: don't try to access '//HEAD' during repo discovery
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 3, 2017, 12:36 UTC
- Message-ID
- <alpine.DEB.2.21.1.1711031334000.6482@virtualbox>
- In-Reply-To
- <20171103010645.25499-1-szeder.dev@gmail.com>
Hi Gábor,
On Fri, 3 Nov 2017, SZEDER Gábor wrote:
Show 11 quoted lines
> Commit ce9b8aab5 (setup_git_directory_1(): avoid changing global state, > 2017-03-13) changed how the git directory is discovered, and as a side > effect when the discovery reaches the root directory Git tries to > access paths like '//HEAD' and '//objects'. This interacts badly with > Cygwin, which interprets it as a UNC file share, and so demand-loads a > bunch of extra DLLs and attempts to resolve/contact the server named > HEAD. This obviously doesn't work too well, especially over a slow > network link. > > Special case the root directory in is_git_directory() to prevent > accessing paths with leading double slashes.
I would rather not special-case the (Unix) root directory. The underlying problem, as Peff pointed out, is that an extra slash is appended if the directory. And as `is_git_directory()` is not marked as static, we must assume that there are other callers that may pass in directory paths ending in a slash already.
Ciao, Dscho