Repository: Improved GetForEachRef

Removed unnecessary replace