Skip to content

Commit

Permalink
Comment forthcoming dependency changes for gix-testtools
Browse files Browse the repository at this point in the history
- 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 GitoxideLabs#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`.
  • Loading branch information
EliahKagan committed Jan 27, 2025
1 parent 0be882a commit cdc4195
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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()?
Expand Down

0 comments on commit cdc4195

Please sign in to comment.