We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ee9ebd commit 5781edeCopy full SHA for 5781ede
src/tests/git.rs
@@ -2,6 +2,7 @@ use std::fs;
2
use std::env;
3
use std::thread;
4
use std::path::PathBuf;
5
+use std::sync::{Once, ONCE_INIT};
6
7
use git2;
8
use url::Url;
@@ -14,8 +15,14 @@ pub fn checkout() -> PathBuf { root().join("checkout") }
14
15
pub fn bare() -> PathBuf { root().join("bare") }
16
17
pub fn init() {
18
+ static INIT: Once = ONCE_INIT;
19
let _ = fs::remove_dir_all(&checkout());
20
let _ = fs::remove_dir_all(&bare());
21
+
22
+ INIT.call_once(|| {
23
+ fs::create_dir_all(root().parent().unwrap()).unwrap();
24
+ });
25
26
// Prepare a bare remote repo
27
{
28
let bare = git2::Repository::init_bare(&bare()).unwrap();
0 commit comments