Re: [PATCH] setup.c: don't try to access '//HEAD' during repo discovery
- Date: Fri, 3 Nov 2017 13:36:45 +0100 (CET)
- From: Johannes Schindelin <Johannes.Schindelin@xxxxxx>
- Subject: Re: [PATCH] setup.c: don't try to access '//HEAD' during repo discovery
On Fri, 3 Nov 2017, SZEDER Gábor wrote:
> 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.