From 652ceb62fa7ef3912af34d44156b34eb7f7d8d4b Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Sat, 14 Mar 2026 22:24:57 +0000 Subject: [PATCH] http_client: Fix GitHub downloads failing if the destination path exists (#51548) (cherry-pick to preview) (#51556) Cherry-pick of #51548 to preview ---- cc https://github.com/zed-industries/zed/pull/45428#issuecomment-4060334728 Release Notes: - N/A *or* Added/Fixed/Improved ... Co-authored-by: Lukas Wirth --- crates/http_client/src/github_download.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/http_client/src/github_download.rs b/crates/http_client/src/github_download.rs index 642bbf11c11ce8816a1506c3c4989dce434552d8..2ef615ff64c2b564e5c254b9c6ef21413d18bcf2 100644 --- a/crates/http_client/src/github_download.rs +++ b/crates/http_client/src/github_download.rs @@ -155,6 +155,7 @@ async fn cleanup_staging_path(staging_path: &Path, asset_kind: AssetKind) { } async fn finalize_download(staging_path: &Path, destination_path: &Path) -> Result<()> { + _ = async_fs::remove_dir_all(destination_path).await; async_fs::rename(staging_path, destination_path) .await .with_context(|| format!("renaming {staging_path:?} to {destination_path:?}"))?;