From e5d72b13fffc18ced71452e13015b7d1d8030625 Mon Sep 17 00:00:00 2001 From: Eliah Kagan <degeneracypressure@gmail.com> Date: Sun, 26 Jan 2025 12:31:16 -0500 Subject: [PATCH] Comment forthcoming dependency changes for gix-testtools - Add a TODO comment about changing `Exponential` to `Quadratic`. This cannot be done yet, but when upgrading dependencies, it will need to be done (since the rename is a breaking change). - Replace the TODO comment about `login_shell()` with one about how to use the value of `shell()` on Windows, and modify the last component, since #1758 replaced `login_shell()` with `shell()`. `shell()` returns a path to `sh`, and gix-testtools currently needs `bash` for fixtures. But the specific approach for finding `sh.exe` relative to the Git for Windows `git-core` directory also works for `bash.exe`. --- tests/tools/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tools/src/lib.rs b/tests/tools/src/lib.rs index cb91c0b87c6..82510d627de 100644 --- a/tests/tools/src/lib.rs +++ b/tests/tools/src/lib.rs @@ -219,6 +219,7 @@ pub fn spawn_git_daemon(working_dir: impl AsRef<Path>) -> std::io::Result<GitDae .spawn()?; let server_addr = addr_at(free_port); + // TODO(deps): Upgrading dependencies will require changing `Exponential` to `Quadratic`. for time in gix_lock::backoff::Exponential::default_with_random() { std::thread::sleep(time); if std::net::TcpStream::connect(server_addr).is_ok() { @@ -652,8 +653,8 @@ fn configure_command<'a, I: IntoIterator<Item = S>, S: AsRef<OsStr>>( } fn bash_program() -> &'static Path { - // TODO: use `gix_path::env::login_shell()` when available. if cfg!(windows) { + // TODO(deps): Once `gix_path::env::shell()` is available, maybe do `shell().parent()?.join("bash.exe")` static GIT_BASH: Lazy<Option<PathBuf>> = Lazy::new(|| { GIT_CORE_DIR .parent()?