refactor: clean up eprintln use

This commit is contained in:
Paul Campbell 2024-06-13 20:00:04 +01:00
parent 588666ffe1
commit 9b970835c8
4 changed files with 7 additions and 33 deletions

View file

@ -176,10 +176,8 @@ impl TestOpenRepository {
fetch = +refs/heads/*:refs/remotes/origin/*
"#
);
// eprintln!("{config_file:?}:\n{updated_contents}");
#[allow(clippy::expect_used)]
fs.file_write(&config_file, &updated_contents)
.expect("write updated .git/config");
eprintln!("write origin to .git/config")
.expect("write updated .git/config")
}
}

View file

@ -386,8 +386,7 @@ mod commit_log {
Ok(open_repository) = test_repository.open(&gitdir),
"open repository"
);
for i in [0; 10] {
eprintln!("create commit {i}");
for _ in [0; 10] {
then::create_a_commit_on_branch(&fs, &gitdir, &branch_name)?;
}
// search to garbage to get all 10 items

View file

@ -475,9 +475,6 @@ pub mod then {
branch_name: &git_next_config::BranchName,
gitdir: &git_next_config::GitDir,
) -> TestResult {
eprintln!("git checkout {branch_name} in {gitdir}");
ls_la(gitdir)?;
which_git()?;
exec(
format!("git checkout -b {}", branch_name),
std::process::Command::new("/usr/bin/git")
@ -485,7 +482,6 @@ pub mod then {
.args(["checkout", "-b", branch_name.to_string().as_str()])
.output(),
)?;
eprintln!("git checkout OKAY");
Ok(())
}
@ -557,25 +553,6 @@ pub mod then {
)
}
#[allow(dead_code)]
pub fn which_git() -> TestResult {
exec(
"which git".to_string(),
std::process::Command::new("which").args(["git"]).output(),
)
}
#[allow(dead_code)]
pub fn ls_la(gitdir: &git_next_config::GitDir) -> TestResult {
exec(
"ls -la".to_string(),
std::process::Command::new("ls")
.current_dir(gitdir.to_path_buf())
.args(["-la"])
.output(),
)
}
pub fn get_sha_for_branch(
fs: &kxio::fs::FileSystem,
gitdir: &git_next_config::GitDir,

View file

@ -304,7 +304,7 @@ mod positions {
);
//then
eprintln!("{err:?}");
eprintln!("Got: {err:?}");
// NOTE: assertions for correct push are in on_push above
assert!(matches!(
err,
@ -371,7 +371,7 @@ mod positions {
);
//then
eprintln!("{err:?}");
eprintln!("Got: {err:?}");
let_assert!(
Ok(sha_next) =
then::get_sha_for_branch(&fs, &gitdir, &repo_config.branches().next()),
@ -457,7 +457,7 @@ mod positions {
);
//then
eprintln!("{err:?}");
eprintln!("Got: {err:?}");
// NOTE: assertions for correct push are in on_push above
assert!(matches!(
err,
@ -522,7 +522,7 @@ mod positions {
);
//then
eprintln!("{err:?}");
eprintln!("Got: {err:?}");
let_assert!(
Ok(sha_next) =
then::get_sha_for_branch(&fs, &gitdir, &repo_config.branches().next()),
@ -571,7 +571,7 @@ mod positions {
);
//then
eprintln!("{positions:#?}");
eprintln!("positions: {positions:#?}");
let_assert!(
Ok(main_sha) =