refactor: clean up eprintln use
This commit is contained in:
parent
588666ffe1
commit
9b970835c8
4 changed files with 7 additions and 33 deletions
|
@ -176,10 +176,8 @@ impl TestOpenRepository {
|
||||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
// eprintln!("{config_file:?}:\n{updated_contents}");
|
|
||||||
#[allow(clippy::expect_used)]
|
#[allow(clippy::expect_used)]
|
||||||
fs.file_write(&config_file, &updated_contents)
|
fs.file_write(&config_file, &updated_contents)
|
||||||
.expect("write updated .git/config");
|
.expect("write updated .git/config")
|
||||||
eprintln!("write origin to .git/config")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -386,8 +386,7 @@ mod commit_log {
|
||||||
Ok(open_repository) = test_repository.open(&gitdir),
|
Ok(open_repository) = test_repository.open(&gitdir),
|
||||||
"open repository"
|
"open repository"
|
||||||
);
|
);
|
||||||
for i in [0; 10] {
|
for _ in [0; 10] {
|
||||||
eprintln!("create commit {i}");
|
|
||||||
then::create_a_commit_on_branch(&fs, &gitdir, &branch_name)?;
|
then::create_a_commit_on_branch(&fs, &gitdir, &branch_name)?;
|
||||||
}
|
}
|
||||||
// search to garbage to get all 10 items
|
// search to garbage to get all 10 items
|
||||||
|
|
|
@ -475,9 +475,6 @@ pub mod then {
|
||||||
branch_name: &git_next_config::BranchName,
|
branch_name: &git_next_config::BranchName,
|
||||||
gitdir: &git_next_config::GitDir,
|
gitdir: &git_next_config::GitDir,
|
||||||
) -> TestResult {
|
) -> TestResult {
|
||||||
eprintln!("git checkout {branch_name} in {gitdir}");
|
|
||||||
ls_la(gitdir)?;
|
|
||||||
which_git()?;
|
|
||||||
exec(
|
exec(
|
||||||
format!("git checkout -b {}", branch_name),
|
format!("git checkout -b {}", branch_name),
|
||||||
std::process::Command::new("/usr/bin/git")
|
std::process::Command::new("/usr/bin/git")
|
||||||
|
@ -485,7 +482,6 @@ pub mod then {
|
||||||
.args(["checkout", "-b", branch_name.to_string().as_str()])
|
.args(["checkout", "-b", branch_name.to_string().as_str()])
|
||||||
.output(),
|
.output(),
|
||||||
)?;
|
)?;
|
||||||
eprintln!("git checkout OKAY");
|
|
||||||
Ok(())
|
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(
|
pub fn get_sha_for_branch(
|
||||||
fs: &kxio::fs::FileSystem,
|
fs: &kxio::fs::FileSystem,
|
||||||
gitdir: &git_next_config::GitDir,
|
gitdir: &git_next_config::GitDir,
|
||||||
|
|
|
@ -304,7 +304,7 @@ mod positions {
|
||||||
);
|
);
|
||||||
|
|
||||||
//then
|
//then
|
||||||
eprintln!("{err:?}");
|
eprintln!("Got: {err:?}");
|
||||||
// NOTE: assertions for correct push are in on_push above
|
// NOTE: assertions for correct push are in on_push above
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
err,
|
err,
|
||||||
|
@ -371,7 +371,7 @@ mod positions {
|
||||||
);
|
);
|
||||||
|
|
||||||
//then
|
//then
|
||||||
eprintln!("{err:?}");
|
eprintln!("Got: {err:?}");
|
||||||
let_assert!(
|
let_assert!(
|
||||||
Ok(sha_next) =
|
Ok(sha_next) =
|
||||||
then::get_sha_for_branch(&fs, &gitdir, &repo_config.branches().next()),
|
then::get_sha_for_branch(&fs, &gitdir, &repo_config.branches().next()),
|
||||||
|
@ -457,7 +457,7 @@ mod positions {
|
||||||
);
|
);
|
||||||
|
|
||||||
//then
|
//then
|
||||||
eprintln!("{err:?}");
|
eprintln!("Got: {err:?}");
|
||||||
// NOTE: assertions for correct push are in on_push above
|
// NOTE: assertions for correct push are in on_push above
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
err,
|
err,
|
||||||
|
@ -522,7 +522,7 @@ mod positions {
|
||||||
);
|
);
|
||||||
|
|
||||||
//then
|
//then
|
||||||
eprintln!("{err:?}");
|
eprintln!("Got: {err:?}");
|
||||||
let_assert!(
|
let_assert!(
|
||||||
Ok(sha_next) =
|
Ok(sha_next) =
|
||||||
then::get_sha_for_branch(&fs, &gitdir, &repo_config.branches().next()),
|
then::get_sha_for_branch(&fs, &gitdir, &repo_config.branches().next()),
|
||||||
|
@ -571,7 +571,7 @@ mod positions {
|
||||||
);
|
);
|
||||||
|
|
||||||
//then
|
//then
|
||||||
eprintln!("{positions:#?}");
|
eprintln!("positions: {positions:#?}");
|
||||||
|
|
||||||
let_assert!(
|
let_assert!(
|
||||||
Ok(main_sha) =
|
Ok(main_sha) =
|
||||||
|
|
Loading…
Reference in a new issue