mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 18:46:49 +00:00
Adjust tests to not create repositories inside repositories
This commit is contained in:
parent
ab952f1b31
commit
2c2076bd77
1 changed files with 15 additions and 3 deletions
|
@ -29,7 +29,7 @@ use std::{
|
||||||
sync::{
|
sync::{
|
||||||
atomic::{AtomicBool, Ordering::SeqCst},
|
atomic::{AtomicBool, Ordering::SeqCst},
|
||||||
Arc,
|
Arc,
|
||||||
},
|
}, ffi::OsStr,
|
||||||
};
|
};
|
||||||
use util::ResultExt;
|
use util::ResultExt;
|
||||||
|
|
||||||
|
@ -765,7 +765,7 @@ async fn apply_client_operation(
|
||||||
contents,
|
contents,
|
||||||
} => {
|
} => {
|
||||||
if !client.fs.directories().contains(&repo_path) {
|
if !client.fs.directories().contains(&repo_path) {
|
||||||
return Err(TestError::Inapplicable);
|
client.fs.create_dir(&repo_path).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
log::info!(
|
log::info!(
|
||||||
|
@ -791,7 +791,7 @@ async fn apply_client_operation(
|
||||||
new_branch,
|
new_branch,
|
||||||
} => {
|
} => {
|
||||||
if !client.fs.directories().contains(&repo_path) {
|
if !client.fs.directories().contains(&repo_path) {
|
||||||
return Err(TestError::Inapplicable);
|
client.fs.create_dir(&repo_path).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
log::info!(
|
log::info!(
|
||||||
|
@ -1704,6 +1704,12 @@ impl TestPlan {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.clone();
|
.clone();
|
||||||
|
|
||||||
|
let repo_path = if repo_path.file_name() == Some(&OsStr::new(".git")) {
|
||||||
|
repo_path.parent().unwrap().join(Alphanumeric.sample_string(&mut self.rng, 16))
|
||||||
|
} else {
|
||||||
|
repo_path
|
||||||
|
};
|
||||||
|
|
||||||
let mut file_paths = client
|
let mut file_paths = client
|
||||||
.fs
|
.fs
|
||||||
.files()
|
.files()
|
||||||
|
@ -1739,6 +1745,12 @@ impl TestPlan {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.clone();
|
.clone();
|
||||||
|
|
||||||
|
let repo_path = if repo_path.file_name() == Some(&OsStr::new(".git")) {
|
||||||
|
repo_path.parent().unwrap().join(Alphanumeric.sample_string(&mut self.rng, 16))
|
||||||
|
} else {
|
||||||
|
repo_path
|
||||||
|
};
|
||||||
|
|
||||||
let new_branch = (self.rng.gen_range(0..10) > 3)
|
let new_branch = (self.rng.gen_range(0..10) > 3)
|
||||||
.then(|| Alphanumeric.sample_string(&mut self.rng, 8));
|
.then(|| Alphanumeric.sample_string(&mut self.rng, 8));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue