Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab
https://github.com/Turbo87/hosted-git-info-rs.git
hosted-git-info ==============================================================================
Provides metadata and conversions from repository urls for [GitHub], [Bitbucket] and [GitLab].
This is a [Rust] port of the original [hosted-git-info] project on [npm].
This will let you identify and transform various git hosts URLs between
protocols. It also can tell you what the URL is for the raw path for
particular file for direct access without git.
Usage
use hosted_git_info::HostedGitInfo;
fn main() {
let url = "https://github.com/foo/bar.git#branch";
let info = HostedGitInfo::from_url(url).unwrap();
assert_eq!(info.provider, Provider::GitHub);
assert_eq!(info.user, Some("foo"));
assert_eq!(info.project, "bar");
assert_eq!(info.committish, Some("branch"));
}
MSRV
Related
License