title: git checkout (Windows 10/mingw64) errors with "no such file or directory"
body: <p>Trying to develop in Windows 10 with a project that was developed on Linux.  Code is stored in GitLab, and I'm seeing the following error with multiple repositories.  Using git version 2.15.1.windows.2</p>
  
  <p>Here's an example:</p>
  
  <pre><code>→ git pull
  remote: Counting objects: 5, done.
  remote: Compressing objects: 100% (5/5), done.
  remote: Total 5 (delta 0), reused 0 (delta 0)
  Unpacking objects: 100% (5/5), done.
  From myurl:project/master
     c23fc916..6dd18de8  master     -&gt; origin/master
  error: unable to create file test/template/PRN.template: No such file or directory
  Updating c23fc916..6dd18de8
  </code></pre>
  
  <p>Definitely not the long path (Longer file names were checked out, and I've moved the directory to shorten the total length):</p>
  
  <pre><code>→ git config --system -l
  ...
  core.longpaths=true
  </code></pre>
  
  <p>Further, it wrote 3 other files in that directory before erroring out:</p>
  
  <pre><code>→ ls -1 test/template/
  'Complex Testing Scenario.template'
  create_from_template.py
  Scheduled.template
  </code></pre>
  
  <p>If I use GIT_TRACE, I see:</p>
  
  <pre><code>→ GIT_TRACE=1 git pull
  18:16:13.337044 git.c:344               trace: built-in: git 'pull'
  18:16:13.342045 run-command.c:626       trace: run_command: 'fetch' '--update-head-ok'
  18:16:13.355048 git.c:344               trace: built-in: git 'fetch' '--update-head-ok'
  18:16:13.361063 run-command.c:626       trace: run_command: 'C:\ProgramData\chocolatey\bin\PLINK.EXE' 'git@xxxxxxx' 'git-upload-pack '\''xxxxxxx/master.git'\'''
  18:16:19.820957 run-command.c:626       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
  18:16:19.882937 run-command.c:626       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
  18:16:19.897933 git.c:344               trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
  18:16:19.976095 run-command.c:1452      run_processes_parallel: preparing to run up to 1 tasks
  18:16:19.976095 run-command.c:1484      run_processes_parallel: done
  18:16:19.976095 run-command.c:626       trace: run_command: 'gc' '--auto'
  18:16:19.988095 git.c:344               trace: built-in: git 'gc' '--auto'
  18:16:19.999065 run-command.c:626       trace: run_command: 'merge' 'FETCH_HEAD'
  18:16:20.013068 git.c:344               trace: built-in: git 'merge' 'FETCH_HEAD'
  error: unable to create file test/template/PRN.template: No such file or directory
  Updating c23fc916..6dd18de8
  </code></pre>
  
  <p>(BTW, this fails on both Git for Windows, TortoiseGit, and when trying to clone via IntelliJ)</p>
  
  <p>However, if I fire up WSL/Ubuntu and check it out into my home directory (so in my NTFS partition), it works fine:</p>
  
  <pre><code> 2018-01-17 19:49:25   DESKTOP-GPVE514 in /mnt/c/Users/mcrow/Programming
  ○ → git clone --branch master git@xxxxxxxxx/master.git
  Cloning into 'master'...
  remote: Counting objects: 24462, done.
  remote: Compressing objects: 100% (108/108), done.
  remote: Total 24462 (delta 115), reused 87 (delta 68)
  Receiving objects: 100% (24462/24462), 277.43 MiB | 840.00 KiB/s, done.
  Resolving deltas: 100% (17596/17596), done.
  Checking connectivity... done.
  Checking out files: 100% (2521/2521), done.
  </code></pre>
  
  <p>Best I can figure, it's definitely something with Git for Windows writing files, but I can't figure out what.</p>
  
  <p>Here's more info:  After checking out via WSL/Ubuntu, I went to that directory and did a <code>git status</code>.  That shows:</p>
  
  <pre><code>→ git status
  On branch master
  Your branch is up to date with 'origin/master'.
  
  Changes not staged for commit:
    (use "git add/rm &lt;file&gt;..." to update what will be committed)
    (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
  
          deleted:    test/template/PRN.template
  
  no changes added to commit (use "git add" and/or "git commit -a")
  </code></pre>
  
  <p>However, that file is there:</p>
  
  <pre><code>→ ls -1 test/template/
  total 14
  'Complex Testing Scenario.template'
  create_from_template.py
  PRN.template
  Scheduled.template
  </code></pre>
  
  <p>But, from Windows, it's still an issue:</p>
  
  <pre><code>→ git reset --hard HEAD
  error: unable to create file test/template/PRN.template: No such file or directory
  fatal: Could not reset index file to revision 'HEAD'.
  </code></pre>