Fix gitfs regression for tag-based envs

Resolves #10956.
Merge pull request #11006 from terminalmage/10956

Fix gitfs regression for tag-based envs