At the line:
|
const regex = /^(?:(?:(?:(?:@)([\w]+)\/)?(?:([\w-]+)?\/)([\w-\.]+)(?:(?:#)([\w-]+))?)|(?:\.))\/?([\w-\/.]*(?:\.([\w]{2,4}))|[\w\/]*)?(?:\/)?([\w]+)?/mg; |
It seems the # should be an escaped colon \: instead to properly parse the repository:branch part of provided paths. Additionally, the hyphens - might need additional escaping in the bracketed character classes.
Suggested _parsePath regex:
- /^(?:(?:(?:(?:@)([\w]+)\/)?(?:([\w-]+)?\/)([\w-\.]+)(?:(?:#)([\w-]+))?)|(?:\.))\/?([\w-\/.]*(?:\.([\w]{2,4}))|[\w\/]*)?(?:\/)?([\w]+)?/mg;
+ /^(?:(?:(?:(?:@)([\w]+)\/)?(?:([\w\-]+)?\/)([\w\-\.]+)(?:(?:\:)([\w\-]+))?)|(?:\.))\/?([\w-\/.]*(?:\.([\w]{2,4}))|[\w\/]*)?(?:\/)?([\w]+)?/mg;
I wonder why the # was used instead of an escaped colon?
At the line:
gitrows/lib/gitpath.js
Line 19 in 05a8a66
It seems the
#should be an escaped colon\:instead to properly parse therepository:branchpart of provided paths. Additionally, the hyphens-might need additional escaping in the bracketed character classes.Suggested _parsePath regex:
I wonder why the
#was used instead of an escaped colon?