parse-git-url
Supports common protocols as specified by the Pro Git book
See: 4.1 Git on the Server - The Protocols
Supports parsing SSH/HTTPS repo urls for:
- GitHub
- Bitbucket
- Azure DevOps
- GitLab
See tests/parse.rs for expected output for a variety of inputs.
URLs that use the ssh:// protocol (implicitly or explicitly) undergo a small normalization process in order to be parsed.
Internally uses Url::parse() from the Url crate after normalization.
Supported local paths
- Unix absolute and relative paths are supported.
- Relative Windows paths such as
..\\repo.gitare supported and normalized. - Absolute Windows drive paths such as
C:\\repo.gitandfile:///C:/repo.gitare intentionally unsupported.
Examples
Run example with debug output
$ RUST_LOG=parse_git_url cargo run --example multi
$ RUST_LOG=parse_git_url cargo run --example trim_auth
Simple usage and output
use GitUrl;
Example Output
)
)
Acknowledgments
This repository has been forked from tjtelan/git-url-parse-rs. All credit goes to the original author.