Skip to content

Commit

Permalink
fix remote clones
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed May 28, 2024
1 parent 821037c commit 640c99a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/uv-git/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,16 @@ impl GitCheckout {
paths::remove_dir_all(into)?;
}

let url = Url::from_file_path(&database.repo.path).map_err(|()| {
anyhow::format_err!("Invalid path URL: {}", database.repo.path.display())
})?;

// Perform a local clone of the repository, which will attempt to use
// hardlinks to set up the repository. This should speed up the clone operation
// quite a bit if it works.
ProcessBuilder::new("git")
.arg("clone")
.arg("--local")
.arg(url.as_str())
// Make sure to pass the local file path and not a file://... url. If given a url,
// Git treats the repository as a remote origin and gets confused because we don't
// have a HEAD checked out.
.arg(&database.repo.path)
.arg(into)
.exec_with_streaming(&mut silent, &mut silent, true)?;

Expand Down

0 comments on commit 640c99a

Please sign in to comment.