From: Jeff King Date: Fri, 03 Nov 2017 18:38:36 GMT Subject: Re: [PATCH] setup: avoid double slashes when looking for HEAD Message-ID: <20171103183836.zpsspuj2xbufuu7u@sigill.intra.peff.net> In-Reply-To: <9322728aaa3010c0b71574eb5876548487d66885.1509713589.git.johannes.schindelin@gmx.de> On Fri, Nov 03, 2017 at 01:58:02PM +0100, Johannes Schindelin wrote: > From: Jeff King > > Andrew Baumann reported that when called outside of any Git worktree, > `git rev-parse --is-inside-work-tree` eventually tries to access > `//HEAD`, i.e. any `HEAD` file in the root directory, but with a double > slash. > > This double slash is not only unintentional, but is allowed by the POSIX > standard to have a special meaning. And most notably on Windows, it > does, where it refers to a UNC path of the form `//server/share/`. > > As a consequence, afore-mentioned `rev-parse` call not only looks for > the wrong thing, but it also causes serious delays, as Windows will try > to access a server called `HEAD`. Let's simply avoid the unintended > double slash. > > Signed-off-by: Jeff King > Acked-by: Johannes Schindelin Thanks, this explanation looks good to me (and the patch is flawless, of course ;) ). -Peff