Allow slashes in gitfs envs, Fix #5007
Add new ref logic to _get_ref as well
Merge pull request #5253 from basepi/gitfs5007

Allow slashes in gitfs envs, Fix #5007