Skip to content

Commit

Permalink
make child_remote_url a Url and pass it to update_submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-crespo committed Jun 8, 2023
1 parent 6343e68 commit 2717a34
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cargo/sources/git/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ impl<'a> GitCheckout<'a> {
new_parent_remote_url.set_path(&new_path);

match new_parent_remote_url.join(child_url_str) {
Ok(x) => x.to_string(),
Ok(x) => x,
Err(err) => Err(err).with_context(|| {
format!(
"failed to parse relative child submodule url `{}` using parent base url `{}`",
Expand All @@ -463,7 +463,7 @@ impl<'a> GitCheckout<'a> {
})?,
}
} else {
child_url_str.to_string()
Url::parse(child_url_str)?
};

// A submodule which is listed in .gitmodules but not actually
Expand All @@ -484,7 +484,7 @@ impl<'a> GitCheckout<'a> {
let mut repo = match head_and_repo {
Ok((head, repo)) => {
if child.head_id() == head {
return update_submodules(&repo, cargo_config, parent_remote_url);
return update_submodules(&repo, cargo_config, &child_remote_url);
}
repo
}
Expand All @@ -501,7 +501,7 @@ impl<'a> GitCheckout<'a> {
.status("Updating", format!("git submodule `{}`", child_remote_url))?;
fetch(
&mut repo,
&child_remote_url,
child_remote_url.as_str(),
&reference,
cargo_config,
RemoteKind::GitDependency,
Expand All @@ -516,7 +516,7 @@ impl<'a> GitCheckout<'a> {

let obj = repo.find_object(head, None)?;
reset(&repo, &obj, cargo_config)?;
update_submodules(&repo, cargo_config, parent_remote_url)
update_submodules(&repo, cargo_config, &child_remote_url)
}
}
}
Expand Down

0 comments on commit 2717a34

Please sign in to comment.