Should have used -d instead of -f for detecting .git :(
One more quotes issue