title: git tag: fatal: Failed to resolve 'HEAD' as a valid ref
body: <p>I am cloning a single branch from a repository and creating a tag in a python script. The commands are as follows.</p>
  
  <pre><code>git clone -b master --single-branch &lt;repository adress&gt;
  
  git tag -a testag -m 'test'
  </code></pre>
  
  <p>It clones successfully but when it comes to adding the tag, it breaks with the following error:</p>
  
  <pre><code>fatal: Failed to resolve 'HEAD' as a valid ref.
  </code></pre>