diff --git a/Cargo.lock b/Cargo.lock index 0ee4a5de017..5c5ec3016ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -211,7 +211,7 @@ dependencies = [ "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "swirl 0.1.0 (git+https://github.com/sgrif/swirl.git?rev=de5d8bb)", "tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2266,15 +2266,6 @@ dependencies = [ "xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tempfile" version = "3.0.4" @@ -3042,7 +3033,6 @@ dependencies = [ "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" "checksum tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)" = "b3196bfbffbba3e57481b6ea32249fbaf590396a52505a2615adbb79d9d826d3" -"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" "checksum tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "55c1195ef8513f3273d55ff59fe5da6940287a0d7a98331254397f464833675b" "checksum tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9de21546595a0873061940d994bbbc5c35f024ae4fd61ec5c5b159115684f508" "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83" diff --git a/Cargo.toml b/Cargo.toml index f89dd570747..30e936dffb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,7 @@ docopt = "1.0" scheduled-thread-pool = "0.2.0" derive_deref = "1.0.0" reqwest = "0.9.1" -tempdir = "0.3.7" +tempfile = "3" parking_lot = "0.7.1" jemallocator = { version = "0.3", features = ['unprefixed_malloc_on_supported_platforms', 'profiling'] } diff --git a/src/git.rs b/src/git.rs index d2d289b1cbd..e4a1f326c51 100644 --- a/src/git.rs +++ b/src/git.rs @@ -4,7 +4,7 @@ use std::collections::HashMap; use std::fs::{self, OpenOptions}; use std::path::{Path, PathBuf}; use swirl::PerformError; -use tempdir::TempDir; +use tempfile::{Builder, TempDir}; use url::Url; use crate::background_jobs::Environment; @@ -148,7 +148,7 @@ pub struct Repository { impl Repository { pub fn open(repository_config: &RepositoryConfig) -> Result { - let checkout_path = TempDir::new("git")?; + let checkout_path = Builder::new().prefix("git").tempdir()?; let repository = git2::build::RepoBuilder::new() .fetch_options(Self::fetch_options(&repository_config.credentials))