diff options
author | Jeff King <peff@peff.net> | 2017-11-03 13:58:02 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-03 23:02:25 +0900 |
commit | fa4d8c783d780191d98fe1f68ad2dea2fe78d19c (patch) | |
tree | cb763d9b256516973511c149fffeb468502c62cf /diff-lib.c | |
parent | setup.c: mention unresolved problems (diff) | |
download | tgif-fa4d8c783d780191d98fe1f68ad2dea2fe78d19c.tar.xz |
setup: avoid double slashes when looking for HEAD
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 <peff@peff.net>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
0 files changed, 0 insertions, 0 deletions