title: Git push to remote fails: Unable to create../refs/heads/master.lock: Invalid argument
body: <p>I have my git bare repo initialized in remote server folder /home/bare/mygit.git</p>
  
  <p>I've cloned this repo:</p>
  
  <pre><code>git clone user@ip.of.my.server:/home/bare/mygit.git .
  </code></pre>
  
  <p>Then I was working with project, doing commits/pushs, etc...</p>
  
  <p>But today I noticed when I was doing a push this error:</p>
  
  <pre><code>user@host:/var/www/mygit (master)$ git push origin master
  user@ip.of.my.server's password: 
  Counting objects: 5, done.
  Compressing objects: 100% (3/3), done.
  Writing objects: 100% (3/3), 297 bytes, done.
  Total 3 (delta 2), reused 0 (delta 0)
  fatal: Unable to create '/home/bare/mygit.git/refs/heads/master.lock': Invalid argument
  fatal: The remote end hung up unexpectedly
  fatal: recursion detected in die handler
  </code></pre>
  
  <p>I searched this issue, but seems like mostly people have problem with a permissions. But in that case error looks different (like Permission denied or something).</p>
  
  <p>Rights is ok, clonning/pulling/fetching is okay. No errors in log or something like that.</p>