I had this problem too. I used your suggested code ^ to solve this issue on my workflow and posted my workaround here: Checkout fails on git-tags, when .git directory is already present
I had this problem too. I used your suggested code ^ to solve this issue on my workflow and posted my workaround here: Checkout fails on git-tags, when .git directory is already present