jonschlinkert / parse-github-url

Parse a Github URL into an object. Supports a wide variety of GitHub URL formats.
MIT License
121 stars 21 forks source link

Urls that contain `tree` anywhere in the filepath break branch parsing #16

Closed lehnerm closed 4 months ago

lehnerm commented 5 years ago

The occurrence of tree in the url is checked without respect to position (see index.js), which leads to an error in parsing the correct branch from the url.

Example case: https://github.com/contentful/extensions/blob/master/samples/content-tree/extension.json

Will return: branch: 'extension.json'

Should return: branch: 'master'