cake-contrib / Cake.AddinDiscoverer

Tool to aid with discovering information about Cake Addins
MIT License
5 stars 6 forks source link

Index was out of range exception when precessing an addin with very short repo name #208

Closed Jericho closed 2 years ago

Jericho commented 2 years ago

The Misc.DeriveGitHubRepositoryInfo method tries to infer the name of the GitHub repo and its owner based on a GitHub URL such as https://github.com/<user>/<repo>. This works quite well. However, we also trim .git from the end of the repo name and we invoke the TrimEnd method to do so. This method contains a bug that causes the Index out of range exception when the string being trimmed is shorted than the string to trim.

So, given a URL such as https://github.com/wgnf/liz we derive the repo name to be liz which is 3 characters long; this is shorter the the 4 character .git string that we attempt to trim.