Improved handling of tag and branch names in prompt.