GitPath parser invalid match · Issue #39 · gitrows/gitrows · GitHub
Skip to content

GitPath parser invalid match #39

Description

@dleeftink

At the line:

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions