Subject: Cygwin Git with Windows paths

From: Steven Penny <[email-masked]>
Date: Sun, 18 Nov 2018 07:21:58 -0800 (PST)

Cygwin programs can handle Unix form paths:

    $ ls /var
    cache  lib  log  run  tmp

and also Windows form paths:

    $ ls 'C:\cygwin64\var'
    cache  lib  log  run  tmp

However current Cygwin Git cannot:

    $ git clone git://github.com/benhoyt/goawk 'C:\cygwin64\tmp\goawk'
    Cloning into 'C:\cygwin64\tmp\goawk'...
    fatal: Invalid path '/home/Steven/C:\cygwin64\tmp\goawk': No such file or
    directory

It seems the problem is that Git thinks the Windows form path is relative
because it does not start with "/". A Git Bisect reveals this:

05b458c104708141d2fad211d79703b3b99cc5a8 is the first bad commit
commit 05b458c104708141d2fad211d79703b3b99cc5a8
Author: Brandon Williams <[email-masked]>
Date:   Mon Dec 12 10:16:52 2016 -0800

    real_path: resolve symlinks by hand

    The current implementation of real_path uses chdir() in order to resolve
    symlinks.  Unfortunately this isn't thread-safe as chdir() affects a
    process as a whole and not just an individual thread.  Instead perform
    the symlink resolution by hand so that the calls to chdir() can be
    removed, making real_path one step closer to being reentrant.

    Signed-off-by: Brandon Williams <[email-masked]>
    Signed-off-by: Junio C Hamano <[email-masked]>

This causes problems for any non-Cygwin tools that might call Git:

http://github.com/golang/go/issues/23155