MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / determine_repo_kind

Function determine_repo_kind

flow-quickstart/src/git.rs:333–345  ·  view source on GitHub ↗

determines what kind of repository we got

(remote_url: &str)

Source from the content-addressed store, hash-verified

331
332/// determines what kind of repository we got
333fn determine_repo_kind(remote_url: &str) -> RepoKind {
334 if remote_url.starts_with("git@") {
335 RepoKind::RemoteSsh
336 } else if remote_url.starts_with("http://") {
337 RepoKind::RemoteHttp
338 } else if remote_url.starts_with("https://") {
339 RepoKind::RemoteHttps
340 } else if Path::new(remote_url).exists() {
341 RepoKind::LocalFolder
342 } else {
343 RepoKind::Invalid
344 }
345}
346
347#[cfg(test)]
348mod tests {

Callers 2

newMethod · 0.85

Calls

no outgoing calls

Tested by 1