title: How to get Vim to open .git\COMMIT_EDITMSG instead of .git\.git\COMMIT_EDITMSG?
body: <p>For some reason, vim keeps trying to open file <strong>COMMIT_EDITMSG</strong> from the wrong path every time. I've been doing multiline commit messages using git-gui cause I was too lazy to fix this problem but I'm getting tired of opening explorer just to commit something. Here's a screengrab that shows what happens when I try to edit a previous commit message:</p>
  
  <p><img src="https://i.stack.imgur.com/O9jne.png" alt="enter image description here"></p>
  
  <p>And when I try to write the file(note the wrong path):  </p>
  
  <p><img src="https://i.stack.imgur.com/ngrxG.png" alt="enter image description here"></p>
  
  <p>It suddenly works when you change the editor to <strong>notepad</strong>:</p>
  
  <p><img src="https://i.stack.imgur.com/opWIp.png" alt="enter image description here"></p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>I've narrowed down the possible causes of the problem to these two settings(after a clean installation and some trial and error):</p>
  
  <pre><code>set autochdir
  set encoding=utf-8
  </code></pre>
  
  <p>The error can be reproduced with only these two lines your <strong>.vimrc</strong>(at least in mines). The strange thing is that, commenting out one of these statements causes the error to disappear.</p>
  
  <p>Another way to reproduce that error is through these commands:</p>
  
  <p>You should get <code>".git\COMMIT_EDITMSG" [New DIRECTORY]</code> with this commmand:  </p>
  
  <pre><code>vim -N -u NONE --cmd "set autochdir | set encoding=utf-8" .git\COMMIT_EDITMSG
  </code></pre>
  
  <p>And strangely enough, it should open the file with either of these:  </p>
  
  <pre><code>vim -N -u NONE --cmd "set autochdir"        .git\COMMIT_EDITMSG
  vim -N -u NONE --cmd "set encoding=utf-8"   .git\COMMIT_EDITMSG
  </code></pre>