Skip to main content

derive_lfs_url

Function derive_lfs_url 

Source
pub fn derive_lfs_url(remote_url: &str) -> Result<String, EndpointError>
Expand description

Convert a clone URL into the matching LFS endpoint URL.

Rules (mirroring upstream’s NewEndpointFromCloneURL):

  • https://host/pathhttps://host/path.git/info/lfs
  • https://host/path.githttps://host/path.git/info/lfs
  • ssh://[user@]host[:port]/pathhttps://host/path.git/info/lfs (port is dropped — LFS is HTTPS-only at the wire layer)
  • git@host:pathhttps://host/path.git/info/lfs
  • git://host/pathhttps://host/path.git/info/lfs
  • file://path → returned unchanged (used by upstream test infra)