change master -> HEAD

This commit is contained in:
Paul Woolcock 2018-02-12 22:30:15 -05:00
parent b8a0fc7a8b
commit c5d53d7f2c

View file

@ -8,14 +8,14 @@ const GITLAB_USER_CONTENT_BASE_URI: &'static str = "https://gitlab.com";
pub fn get_manifest_uri(repo_path: &RepoPath, path: &RelativePathBuf) -> Result<Uri, Error> { pub fn get_manifest_uri(repo_path: &RepoPath, path: &RelativePathBuf) -> Result<Uri, Error> {
let path_str: &str = path.as_ref(); let path_str: &str = path.as_ref();
// gitlab will return a 308 if the Uri ends with, say, `.../raw/master//Cargo.toml`, so make // gitlab will return a 308 if the Uri ends with, say, `.../raw/HEAD//Cargo.toml`, so make
// sure that last slash isn't doubled // sure that last slash isn't doubled
let slash_path = if path_str.starts_with("/") { let slash_path = if path_str.starts_with("/") {
&path_str[1..] &path_str[1..]
} else { } else {
path_str path_str
}; };
Ok(format!("{}/{}/{}/raw/master/{}", Ok(format!("{}/{}/{}/raw/HEAD/{}",
GITLAB_USER_CONTENT_BASE_URI, GITLAB_USER_CONTENT_BASE_URI,
repo_path.qual.as_ref(), repo_path.qual.as_ref(),
repo_path.name.as_ref(), repo_path.name.as_ref(),