Skip to content

Commit

Permalink
Add documentation for HTTPS remote regex
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmo385 committed Jan 29, 2025
1 parent a906e86 commit 7f3f89d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lazy_github/lib/git_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
# "([^.]+)" Match everything until the period, which should be the repo name
# ".git" Match the .git suffix
_SSH_GIT_REMOTE_REGEX = re.compile(r".+:([^\/]+)\/([^.]+)(?:.git)?")

# Regex designed to match something like "https://github.com/gizmo385/gh-lazy.git"
# "^https:\/\/[^.]+[^\/]+" Match the base URL until the first non-prefix slash (eg: https://github.com)
# "([^\/]+)" Match the username (eg: gizmo385)
# "([^\/]+)$" Match the end of the URL (eg: gh-lazy.git)
_HTTPS_GIT_REMOTE_REGEX = re.compile(r"^https:\/\/[^.]+[^\/]+\/([^\/]+)\/([^\/]+)$")


Expand Down

0 comments on commit 7f3f89d

Please sign in to comment.