mirrorcat icon indicating copy to clipboard operation
mirrorcat copied to clipboard

MirrorFinder needs a Case-Insensitive Option

Open marstr opened this issue 8 years ago • 1 comments

Because DefaultMirrorFinder uses a map look-up, both the remote URL and refName are case sensitive. See the line in question here:

https://github.com/Azure/mirrorcat/blob/d43cf479f2f1430ca20ba8758a5872b71ef35144/mirror_finder.go#L65

While I believe that branch names in Git are always case-sensitive, URL parts probably shouldn't be treated as case-sensitive. One clear example that has already bitten me as part of config is configuring mirrorcat to copy: github.com/azure/mirrorcat when the GitHub push event sends github.com/Azure/mirrorcat.

There are a few ways this could be implemented. Honestly, my favorite way would be to rewrite DefaultMirrorFinder to take a Predicate e.g. func(mirrorcat.RemoteRef) bool upon construction. It would then be fairly straight-forward to add decorator types for case sensitive and case insensitive variants of the default behavior.

marstr avatar Dec 19 '17 17:12 marstr

While I believe that branch names in Git are always case-sensitive

Fun fact: VSTS may allow case-insensitive branch names.

JoshuaKGoldberg avatar Dec 24 '17 02:12 JoshuaKGoldberg