Skip to content

Commit 4eb842c

Browse files
committed
adjust to changes in git-testtools
1 parent dbf6c8c commit 4eb842c

File tree

40 files changed

+73
-76
lines changed

40 files changed

+73
-76
lines changed

git-attributes/tests/match_group/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mod ignore {
3232

3333
#[test]
3434
fn from_git_dir() -> crate::Result {
35-
let dir = git_testtools::scripted_fixture_repo_read_only("make_global_and_external_and_dir_ignores.sh")?;
35+
let dir = git_testtools::scripted_fixture_read_only("make_global_and_external_and_dir_ignores.sh")?;
3636
let repo_dir = dir.join("repo");
3737
let git_dir = repo_dir.join(".git");
3838
let baseline = std::fs::read(git_dir.parent().unwrap().join("git-check-ignore.baseline"))?;

git-commitgraph/tests/commitgraph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ pub fn check_common(cg: &Graph, expected: &HashMap<String, RefInfo, impl BuildHa
6060
);
6161
}
6262

63-
use git_testtools::scripted_fixture_repo_read_only;
63+
use git_testtools::scripted_fixture_read_only;
6464
pub fn make_readonly_repo(script_path: &str) -> std::path::PathBuf {
65-
scripted_fixture_repo_read_only(script_path).expect("script succeeds all the time")
65+
scripted_fixture_read_only(script_path).expect("script succeeds all the time")
6666
}
6767

6868
pub fn hex_to_id(hex: &[u8]) -> git_hash::ObjectId {

git-config/tests/file/init/comfort.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn from_environment_overrides() {
2121
#[test]
2222
#[serial]
2323
fn from_git_dir() -> crate::Result {
24-
let worktree_dir = git_testtools::scripted_fixture_repo_read_only("make_config_repo.sh")?;
24+
let worktree_dir = git_testtools::scripted_fixture_read_only("make_config_repo.sh")?;
2525
let git_dir = worktree_dir.join(".git");
2626
let worktree_dir = worktree_dir.canonicalize()?;
2727
let _env = Env::new()
@@ -84,7 +84,7 @@ fn from_git_dir() -> crate::Result {
8484
#[test]
8585
#[serial]
8686
fn from_git_dir_with_worktree_extension() -> crate::Result {
87-
let git_dir = git_testtools::scripted_fixture_repo_read_only("config_with_worktree_extension.sh")?
87+
let git_dir = git_testtools::scripted_fixture_read_only("config_with_worktree_extension.sh")?
8888
.join("main-worktree")
8989
.join(".git");
9090
let config = git_config::File::from_git_dir(git_dir)?;

git-date/tests/time/baseline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct Sample {
1313

1414
static BASELINE: Lazy<HashMap<String, Sample>> = Lazy::new(|| {
1515
(|| -> Result<_> {
16-
let base = git_testtools::scripted_fixture_repo_read_only("generate_git_date_baseline.sh")?;
16+
let base = git_testtools::scripted_fixture_read_only("generate_git_date_baseline.sh")?;
1717
let mut map = HashMap::new();
1818
let file = std::fs::read(base.join("baseline.git"))?;
1919
let baseline = std::str::from_utf8(&file).expect("valid utf");

git-diff/tests/tree/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mod changes {
1111

1212
fn db(args: impl IntoIterator<Item = &'static str>) -> crate::Result<git_odb::Handle> {
1313
git_odb::at(
14-
git_testtools::scripted_fixture_repo_read_only_with_args("make_diff_repo.sh", args)?
14+
git_testtools::scripted_fixture_read_only_with_args("make_diff_repo.sh", args)?
1515
.join(".git")
1616
.join("objects"),
1717
)

git-discover/tests/is_git/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn verify_on_exfat() -> crate::Result<()> {
77

88
use git_discover::repository::Kind;
99

10-
let fixtures = git_testtools::scripted_fixture_repo_read_only("make_exfat_repo_darwin.sh")?;
10+
let fixtures = git_testtools::scripted_fixture_read_only("make_exfat_repo_darwin.sh")?;
1111
let mount_point = tempfile::tempdir()?;
1212

1313
let _cleanup = {

git-discover/tests/isolated.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use serial_test::serial;
66
#[test]
77
#[serial]
88
fn upwards_with_relative_directories_and_optional_ceiling() -> git_testtools::Result {
9-
let repo = git_testtools::scripted_fixture_repo_read_only("make_basic_repo.sh")?;
9+
let repo = git_testtools::scripted_fixture_read_only("make_basic_repo.sh")?;
1010

1111
std::env::set_current_dir(repo.join("subdir"))?;
1212
let cwd = std::env::current_dir()?;

git-discover/tests/upwards/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn cross_fs() -> crate::Result {
226226
return Ok(());
227227
}
228228

229-
let top_level_repo = git_testtools::scripted_fixture_repo_writable("make_basic_repo.sh")?;
229+
let top_level_repo = git_testtools::scripted_fixture_writable("make_basic_repo.sh")?;
230230

231231
let _cleanup = {
232232
// Create an empty dmg file
@@ -307,7 +307,7 @@ fn do_not_shorten_absolute_paths() -> crate::Result {
307307
mod submodules {
308308
#[test]
309309
fn by_their_worktree_checkout() -> crate::Result {
310-
let dir = git_testtools::scripted_fixture_repo_read_only("make_submodules.sh")?;
310+
let dir = git_testtools::scripted_fixture_read_only("make_submodules.sh")?;
311311
let parent = dir.join("with-submodules");
312312
let modules = parent.join(".git").join("modules");
313313
for module in ["m1", "dir/m1"] {
@@ -336,7 +336,7 @@ mod submodules {
336336

337337
#[test]
338338
fn by_their_module_git_dir() -> crate::Result {
339-
let dir = git_testtools::scripted_fixture_repo_read_only("make_submodules.sh")?;
339+
let dir = git_testtools::scripted_fixture_read_only("make_submodules.sh")?;
340340
let modules = dir.join("with-submodules").join(".git").join("modules");
341341
for module in ["m1", "dir/m1"] {
342342
let submodule_m1_gitdir = modules.join(module);
@@ -353,5 +353,5 @@ mod submodules {
353353
}
354354

355355
pub(crate) fn repo_path() -> crate::Result<PathBuf> {
356-
git_testtools::scripted_fixture_repo_read_only("make_basic_repo.sh")
356+
git_testtools::scripted_fixture_read_only("make_basic_repo.sh")
357357
}

git-glob/tests/pattern/matching.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl<'a> Baseline<'a> {
4343

4444
#[test]
4545
fn compare_baseline_with_ours() {
46-
let dir = git_testtools::scripted_fixture_repo_read_only("make_baseline.sh").unwrap();
46+
let dir = git_testtools::scripted_fixture_read_only("make_baseline.sh").unwrap();
4747
let (mut total_matches, mut total_correct, mut panics) = (0, 0, 0);
4848
let mut mismatches = Vec::new();
4949
for (input_file, expected_matches, case) in &[

git-index/tests/index/init.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use git_index::{verify::extensions::no_find, State};
22
use git_repository as git;
33
use git_repository::prelude::FindExt;
4-
use git_testtools::scripted_fixture_repo_read_only;
4+
use git_testtools::scripted_fixture_read_only;
55

66
#[test]
77
fn from_tree() -> crate::Result {
@@ -13,7 +13,7 @@ fn from_tree() -> crate::Result {
1313
];
1414

1515
for fixture in fixtures {
16-
let repo_dir = scripted_fixture_repo_read_only(fixture)?;
16+
let repo_dir = scripted_fixture_read_only(fixture)?;
1717
let repo = git::open(&repo_dir)?;
1818

1919
let tree_id = repo.head_commit()?.tree_id()?;

git-index/tests/index/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod file;
44
mod init;
55

66
pub fn fixture_index_path(name: &str) -> PathBuf {
7-
let dir = git_testtools::scripted_fixture_repo_read_only(Path::new("make_index").join(name).with_extension("sh"))
7+
let dir = git_testtools::scripted_fixture_read_only(Path::new("make_index").join(name).with_extension("sh"))
88
.expect("script works");
99
dir.join(".git").join("index")
1010
}

git-odb/tests/odb/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub use git_testtools::{fixture_path, hex_to_id, scripted_fixture_repo_read_only};
1+
pub use git_testtools::{fixture_path, hex_to_id, scripted_fixture_read_only};
22

33
pub type Result<T = ()> = std::result::Result<T, Box<dyn std::error::Error>>;
44

git-odb/tests/odb/regression/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mod repo_with_small_packs {
2020
#[cfg(feature = "internal-testing-git-features-parallel")]
2121
fn multi_threaded_access_will_not_panic() {
2222
for arg in ["no", "without-multi-index"] {
23-
let base = git_testtools::scripted_fixture_repo_read_only_with_args("make_repo_multi_index.sh", Some(arg))
23+
let base = git_testtools::scripted_fixture_read_only_with_args("make_repo_multi_index.sh", Some(arg))
2424
.unwrap()
2525
.join(".git")
2626
.join("objects");

git-odb/tests/odb/store/dynamic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn db_with_all_object_sources() -> crate::Result<(git_odb::Handle, tempfile::Tem
3434

3535
#[test]
3636
fn multi_index_access() -> crate::Result {
37-
let dir = git_testtools::scripted_fixture_repo_writable("make_repo_multi_index.sh")?;
37+
let dir = git_testtools::scripted_fixture_writable("make_repo_multi_index.sh")?;
3838
let handle = git_odb::at(dir.path().join(".git/objects"))?;
3939

4040
assert_eq!(
@@ -130,7 +130,7 @@ fn multi_index_access() -> crate::Result {
130130

131131
#[test]
132132
fn multi_index_keep_open() -> crate::Result {
133-
let dir = git_testtools::scripted_fixture_repo_writable("make_repo_multi_index.sh")?;
133+
let dir = git_testtools::scripted_fixture_writable("make_repo_multi_index.sh")?;
134134
let (stable_handle, handle) = {
135135
let mut stable_handle = git_odb::at(dir.path().join(".git/objects"))?;
136136
let handle = stable_handle.clone();
@@ -207,7 +207,7 @@ fn write() -> crate::Result {
207207

208208
#[test]
209209
fn object_replacement() {
210-
let dir = git_testtools::scripted_fixture_repo_read_only("make_replaced_history.sh").unwrap();
210+
let dir = git_testtools::scripted_fixture_read_only("make_replaced_history.sh").unwrap();
211211
let handle = git_odb::at(dir.join(".git/objects")).unwrap();
212212
let mut buf = Vec::new();
213213
let short_history_link = hex_to_id("434e5a872d6738d1fffd1e11e52a1840b73668c6");

git-pack/tests/pack/data/output/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn db(kind: DbKind) -> crate::Result<git_odb::HandleArc> {
3131
DeterministicGeneratedContent => "make_pack_gen_repo.sh",
3232
DeterministicGeneratedContentMultiIndex => "make_pack_gen_repo_multi_index.sh",
3333
};
34-
let path: PathBuf = git_testtools::scripted_fixture_repo_read_only(name)?
34+
let path: PathBuf = git_testtools::scripted_fixture_read_only(name)?
3535
.join(".git")
3636
.join("objects");
3737
git_odb::Store::at_opts(path, Vec::new(), git_odb::store::init::Options::default())

git-pack/tests/pack/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const PACKS_AND_INDICES: &[(&'static str, &'static str)] =
1313
const V2_PACKS_AND_INDICES: &[(&'static str, &'static str)] =
1414
&[(SMALL_PACK_INDEX, SMALL_PACK), (INDEX_V2, PACK_FOR_INDEX_V2)];
1515

16-
pub use git_testtools::{fixture_path, hex_to_id, scripted_fixture_repo_read_only};
16+
pub use git_testtools::{fixture_path, hex_to_id, scripted_fixture_read_only};
1717

1818
pub type Result<T = ()> = std::result::Result<T, Box<dyn std::error::Error>>;
1919

git-pack/tests/pack/multi_index/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::path::PathBuf;
33
use git_pack::multi_index::File;
44

55
fn multi_index() -> (File, PathBuf) {
6-
let path = git_testtools::scripted_fixture_repo_read_only("make_pack_gen_repo_multi_index.sh")
6+
let path = git_testtools::scripted_fixture_read_only("make_pack_gen_repo_multi_index.sh")
77
.expect("test fixture exists")
88
.join(".git/objects/pack/multi-pack-index");
99
let file = git_pack::multi_index::File::at(&path).unwrap();

git-pathspec/tests/pathspec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mod parse {
3232
}
3333

3434
static BASELINE: Lazy<HashMap<BString, usize>> = Lazy::new(|| {
35-
let base = git_testtools::scripted_fixture_repo_read_only("generate_pathspec_baseline.sh").unwrap();
35+
let base = git_testtools::scripted_fixture_read_only("generate_pathspec_baseline.sh").unwrap();
3636

3737
(|| -> crate::Result<_> {
3838
let mut map = HashMap::new();

git-ref/tests/file/log.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ mod iter {
3535
use std::path::PathBuf;
3636

3737
fn reflog_dir() -> crate::Result<PathBuf> {
38-
Ok(
39-
git_testtools::scripted_fixture_repo_read_only("make_repo_for_reflog.sh")?
40-
.join(".git")
41-
.join("logs"),
42-
)
38+
Ok(git_testtools::scripted_fixture_read_only("make_repo_for_reflog.sh")?
39+
.join(".git")
40+
.join("logs"))
4341
}
4442
fn reflog(name: &str) -> crate::Result<Vec<u8>> {
4543
Ok(std::fs::read(reflog_dir()?.join(name))?)

git-ref/tests/file/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn store_with_packed_refs() -> crate::Result<Store> {
1414
}
1515

1616
pub fn store_at(name: &str) -> crate::Result<Store> {
17-
let path = git_testtools::scripted_fixture_repo_read_only(name)?;
17+
let path = git_testtools::scripted_fixture_read_only(name)?;
1818
Ok(Store::at(
1919
path.join(".git"),
2020
git_ref::store::WriteReflog::Normal,
@@ -23,7 +23,7 @@ pub fn store_at(name: &str) -> crate::Result<Store> {
2323
}
2424

2525
fn store_writable(name: &str) -> crate::Result<(git_testtools::tempfile::TempDir, Store)> {
26-
let dir = git_testtools::scripted_fixture_repo_writable(name)?;
26+
let dir = git_testtools::scripted_fixture_writable(name)?;
2727
let git_dir = dir.path().join(".git");
2828
Ok((
2929
dir,

git-ref/tests/file/store/reflog.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn store() -> crate::Result<crate::file::Store> {
22
Ok(crate::file::Store::at(
3-
git_testtools::scripted_fixture_repo_read_only("make_repo_for_reflog.sh")?.join(".git"),
3+
git_testtools::scripted_fixture_read_only("make_repo_for_reflog.sh")?.join(".git"),
44
git_ref::store::WriteReflog::Disable,
55
git_hash::Kind::Sha1,
66
))

git-ref/tests/file/worktree.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ fn dir(packed: bool, writable: bool) -> crate::Result<(PathBuf, Option<tempfile:
1111
args.push("packed");
1212
}
1313
if writable {
14-
git_testtools::scripted_fixture_repo_writable_with_args(name, args, Creation::ExecuteScript)
14+
git_testtools::scripted_fixture_writable_with_args(name, args, Creation::ExecuteScript)
1515
.map(|tmp| (tmp.path().to_owned(), tmp.into()))
1616
} else {
17-
git_testtools::scripted_fixture_repo_read_only_with_args(name, args).map(|p| (p, None))
17+
git_testtools::scripted_fixture_read_only_with_args(name, args).map(|p| (p, None))
1818
}
1919
}
2020

git-ref/tests/packed/iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn empty() -> crate::Result {
1717

1818
#[test]
1919
fn packed_refs_with_header() -> crate::Result {
20-
let dir = git_testtools::scripted_fixture_repo_read_only("make_packed_ref_repository.sh")?;
20+
let dir = git_testtools::scripted_fixture_read_only("make_packed_ref_repository.sh")?;
2121
let buf = std::fs::read(dir.join(".git").join("packed-refs"))?;
2222
let iter = packed::Iter::new(&buf)?;
2323
assert_eq!(iter.count(), 8, "it finds the right amount of items");

git-ref/tests/store/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#[cfg(feature = "internal-testing-git-features-parallel")]
33
fn is_send_and_sync() {
44
pub fn store_at(name: &str) -> crate::Result<git_ref::file::Store> {
5-
let path = git_testtools::scripted_fixture_repo_read_only(name)?;
5+
let path = git_testtools::scripted_fixture_read_only(name)?;
66
Ok(git_ref::file::Store::at(
77
path.join(".git"),
88
git_ref::store::WriteReflog::Normal,

git-refspec/tests/matching/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub mod baseline {
204204
}
205205

206206
fn parse_input() -> crate::Result<Vec<Ref>> {
207-
let dir = git_testtools::scripted_fixture_repo_read_only("match_baseline.sh")?;
207+
let dir = git_testtools::scripted_fixture_read_only("match_baseline.sh")?;
208208
let refs_buf = std::fs::read(dir.join("clone").join("remote-refs.list"))?;
209209
let mut out = Vec::new();
210210
for line in refs_buf.lines() {
@@ -228,7 +228,7 @@ pub mod baseline {
228228
}
229229

230230
pub(crate) fn parse() -> crate::Result<Baseline> {
231-
let dir = git_testtools::scripted_fixture_repo_read_only("match_baseline.sh")?;
231+
let dir = git_testtools::scripted_fixture_read_only("match_baseline.sh")?;
232232
let buf = std::fs::read(dir.join("clone").join("baseline.git"))?;
233233

234234
let mut map = HashMap::new();

git-refspec/tests/parse/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use std::panic::catch_unwind;
22

33
use bstr::ByteSlice;
44
use git_refspec::parse::Operation;
5-
use git_testtools::scripted_fixture_repo_read_only;
5+
use git_testtools::scripted_fixture_read_only;
66

77
#[test]
88
fn baseline() {
9-
let dir = scripted_fixture_repo_read_only("parse_baseline.sh").unwrap();
9+
let dir = scripted_fixture_read_only("parse_baseline.sh").unwrap();
1010
let baseline = std::fs::read(dir.join("baseline.git")).unwrap();
1111
let mut lines = baseline.lines();
1212
let mut panics = 0;

git-repository/src/remote/connection/fetch/update_refs/tests.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod update {
77

88
fn base_repo_path() -> String {
99
git::path::realpath(
10-
git_testtools::scripted_fixture_repo_read_only("make_remote_repos.sh")
10+
git_testtools::scripted_fixture_read_only("make_remote_repos.sh")
1111
.unwrap()
1212
.join("base"),
1313
)
@@ -17,12 +17,12 @@ mod update {
1717
}
1818

1919
fn repo(name: &str) -> git::Repository {
20-
let dir = git_testtools::scripted_fixture_repo_read_only_with_args("make_fetch_repos.sh", [base_repo_path()])
21-
.unwrap();
20+
let dir =
21+
git_testtools::scripted_fixture_read_only_with_args("make_fetch_repos.sh", [base_repo_path()]).unwrap();
2222
git::open_opts(dir.join(name), git::open::Options::isolated()).unwrap()
2323
}
2424
fn repo_rw(name: &str) -> (git::Repository, git_testtools::tempfile::TempDir) {
25-
let dir = git_testtools::scripted_fixture_repo_writable_with_args(
25+
let dir = git_testtools::scripted_fixture_writable_with_args(
2626
"make_fetch_repos.sh",
2727
[base_repo_path()],
2828
git_testtools::Creation::ExecuteScript,
@@ -169,7 +169,7 @@ mod update {
169169

170170
#[test]
171171
fn checked_out_branches_in_worktrees_are_rejected_with_additional_information() -> Result {
172-
let root = git_path::realpath(git_testtools::scripted_fixture_repo_read_only_with_args(
172+
let root = git_path::realpath(git_testtools::scripted_fixture_read_only_with_args(
173173
"make_fetch_repos.sh",
174174
[base_repo_path()],
175175
)?)?;

git-repository/tests/clone/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ mod blocking_io {
199199
fn fetch_and_checkout_empty_remote_repo() -> crate::Result {
200200
let tmp = git_testtools::tempfile::TempDir::new()?;
201201
let mut prepare = git::prepare_clone(
202-
git_testtools::scripted_fixture_repo_read_only("make_empty_repo.sh")?,
202+
git_testtools::scripted_fixture_read_only("make_empty_repo.sh")?,
203203
tmp.path(),
204204
)?;
205205
let (mut checkout, out) = prepare

git-repository/tests/remote/fetch.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mod blocking_and_async_io {
1212

1313
pub(crate) fn base_repo_path() -> String {
1414
git::path::realpath(
15-
git_testtools::scripted_fixture_repo_read_only("make_remote_repos.sh")
15+
git_testtools::scripted_fixture_read_only("make_remote_repos.sh")
1616
.unwrap()
1717
.join("base"),
1818
)
@@ -22,13 +22,13 @@ mod blocking_and_async_io {
2222
}
2323

2424
pub(crate) fn repo_path(name: &str) -> std::path::PathBuf {
25-
let dir = git_testtools::scripted_fixture_repo_read_only_with_args("make_fetch_repos.sh", [base_repo_path()])
26-
.unwrap();
25+
let dir =
26+
git_testtools::scripted_fixture_read_only_with_args("make_fetch_repos.sh", [base_repo_path()]).unwrap();
2727
dir.join(name)
2828
}
2929

3030
pub(crate) fn repo_rw(name: &str) -> (git::Repository, git_testtools::tempfile::TempDir) {
31-
let dir = git_testtools::scripted_fixture_repo_writable_with_args(
31+
let dir = git_testtools::scripted_fixture_writable_with_args(
3232
"make_fetch_repos.sh",
3333
[base_repo_path()],
3434
git_testtools::Creation::ExecuteScript,

0 commit comments

Comments
 (0)