Cygwin Git with Windows paths
- From
Steven Penny <svnpenn@gmail.com>
- Date
- Nov 18, 2018, 15:21 UTC
- Message-ID
- <5bf18396.1c69fb81.20780.2b1d@mx.google.com>
Cygwin programs can handle Unix form paths:
$ ls /var
cache lib log run tmpand also Windows form paths:
$ ls 'C:\cygwin64\var'
cache lib log run tmpHowever 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
directoryIt 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 <bmwill@google.com> 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 <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>This causes problems for any non-Cygwin tools that might call Git:
http://github.com/golang/go/issues/23155