Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(bench): unbreak wt-perf invalidate; consolidate env-isolation helpers (#2540)

Maximilian Roosc710147c8c64
diff --git a/benches/alias.rs b/benches/alias.rs
index f28cec585..6b5512ae2 100644
--- a/benches/alias.rs
+++ b/benches/alias.rs
@@ -31,7 +31,8 @@
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use std::path::Path;
use std::process::Command;
-use wt_perf::{RepoConfig, create_repo, invalidate_caches_auto, isolate_cmd};
+use worktrunk::testing::isolate_subprocess_env;
+use wt_perf::{RepoConfig, create_repo, invalidate_caches_auto};
/// Alias body is a shell builtin so the wall-clock is dominated by the
/// parent's dispatch — not by running a real subcommand.
@@ -67,7 +68,7 @@ const fn lean_worktrees(worktrees: usize) -> RepoConfig {
fn wt_cmd(binary: &Path, repo: &Path, user_config: &Path, args: &[&str]) -> Command {
let mut cmd = Command::new(binary);
cmd.args(args).current_dir(repo);
- isolate_cmd(&mut cmd, Some(user_config));
+ isolate_subprocess_env(&mut cmd, Some(user_config));
cmd
}
@@ -92,7 +93,7 @@ fn bench_dispatch(c: &mut Criterion) {
b.iter(|| {
let mut cmd = Command::new(binary);
cmd.arg("--version");
- isolate_cmd(&mut cmd, None);
+ isolate_subprocess_env(&mut cmd, None);
run_and_check(cmd, "wt_version");
});
});
diff --git a/benches/completion.rs b/benches/completion.rs
index fd2fc403e..6c9437b72 100644
--- a/benches/completion.rs
+++ b/benches/completion.rs
@@ -1,13 +1,14 @@
use criterion::{Criterion, criterion_group, criterion_main};
use std::path::Path;
use std::process::Command;
-use wt_perf::{RepoConfig, create_repo, isolate_cmd};
+use worktrunk::testing::isolate_subprocess_env;
+use wt_perf::{RepoConfig, create_repo};
fn run_completion(binary: &Path, repo_path: &Path, words: &[&str]) {
let index = words.len().saturating_sub(1);
let mut cmd = Command::new(binary);
cmd.arg("--").args(words).current_dir(repo_path);
- isolate_cmd(&mut cmd, None);
+ isolate_subprocess_env(&mut cmd, None);
cmd.env("COMPLETE", "bash")
.env("_CLAP_COMPLETE_INDEX", index.to_string())
.env("_CLAP_COMPLETE_COMP_TYPE", "9")
diff --git a/benches/list.rs b/benches/list.rs
index 091ad3c78..70e77b67d 100644
--- a/benches/list.rs
+++ b/benches/list.rs
@@ -23,9 +23,10 @@
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use std::path::{Path, PathBuf};
use std::process::Command;
+use worktrunk::testing::isolate_subprocess_env;
use wt_perf::{
RepoConfig, add_history_spread_branches, add_worktrees, clone_rust_repo, create_repo,
- invalidate_caches_auto, isolate_cmd, run_git, setup_fake_remote,
+ invalidate_caches_auto, run_git, setup_fake_remote,
};
/// Benchmark configuration wrapping RepoConfig with cache state.
@@ -74,7 +75,7 @@ fn run_benchmark(
let cmd_factory = || {
let mut cmd = Command::new(binary);
cmd.args(args).current_dir(repo_path);
- isolate_cmd(&mut cmd, None);
+ isolate_subprocess_env(&mut cmd, None);
if let Some((key, value)) = env {
cmd.env(key, value);
}
@@ -196,7 +197,7 @@ fn bench_real_repo(c: &mut Criterion) {
let make_cmd = || {
let mut cmd = Command::new(binary);
cmd.arg("list").current_dir(&workspace_main);
- isolate_cmd(&mut cmd, None);
+ isolate_subprocess_env(&mut cmd, None);
cmd
};
@@ -333,7 +334,7 @@ fn bench_real_repo_many_branches(c: &mut Criterion) {
let mut cmd = Command::new(binary);
cmd.args(["list", "--branches"])
.current_dir(&workspace_main);
- isolate_cmd(&mut cmd, None);
+ isolate_subprocess_env(&mut cmd, None);
cmd.output().unwrap();
});
});
@@ -344,7 +345,7 @@ fn bench_real_repo_many_branches(c: &mut Criterion) {
b.iter(|| {
let mut cmd = Command::new(binary);
cmd.arg("list").current_dir(&workspace_main); // no --branches
- isolate_cmd(&mut cmd, None);
+ isolate_subprocess_env(&mut cmd, None);
cmd.output().unwrap();
});
});
diff --git a/benches/remove.rs b/benches/remove.rs
index 882819fd8..0f4d322f4 100644
--- a/benches/remove.rs
+++ b/benches/remove.rs
@@ -15,9 +15,8 @@
use criterion::{Criterion, criterion_group, criterion_main};
use std::path::{Path, PathBuf};
use std::process::Command;
-use wt_perf::{
- RepoConfig, invalidate_caches_auto, isolate_cmd, run_git, run_git_ok, setup_fake_remote,
-};
+use worktrunk::testing::isolate_subprocess_env;
+use wt_perf::{RepoConfig, invalidate_caches_auto, run_git, run_git_ok, setup_fake_remote};
/// Create a benchmark repo at a specific path with optional hooks.
fn create_bench_repo(base_path: &Path, with_hooks: bool) -> PathBuf {
@@ -123,7 +122,7 @@ fn bench_remove_e2e(c: &mut Criterion) {
let mut cmd = Command::new(binary);
cmd.args(["remove", "--yes", "--no-hooks", "--force", "feature-wt-1"]);
cmd.current_dir(&repo_no_hooks);
- isolate_cmd(&mut cmd, Some(&user_config_no_hooks));
+ isolate_subprocess_env(&mut cmd, Some(&user_config_no_hooks));
cmd.env("WORKTRUNK_FIRST_OUTPUT", "1");
let output = cmd.output().unwrap();
assert!(
@@ -145,7 +144,7 @@ fn bench_remove_e2e(c: &mut Criterion) {
let mut cmd = Command::new(binary);
cmd.args(["remove", "--yes", "--no-hooks", "--force"]);
cmd.current_dir(&wt_path);
- isolate_cmd(&mut cmd, Some(&user_config_no_hooks));
+ isolate_subprocess_env(&mut cmd, Some(&user_config_no_hooks));
let output = cmd.output().unwrap();
assert!(
output.status.success(),
@@ -166,7 +165,7 @@ fn bench_remove_e2e(c: &mut Criterion) {
let mut cmd = Command::new(binary);
cmd.args(["remove", "--yes", "--force"]);
cmd.current_dir(&wt_path);
- isolate_cmd(&mut cmd, Some(&user_config_with_hooks));
+ isolate_subprocess_env(&mut cmd, Some(&user_config_with_hooks));
let output = cmd.output().unwrap();
assert!(
output.status.success(),
diff --git a/benches/time_to_first_output.rs b/benches/time_to_first_output.rs
index 42b944c57..143887d49 100644
--- a/benches/time_to_first_output.rs
+++ b/benches/time_to_first_output.rs
@@ -16,7 +16,8 @@
use criterion::{Criterion, criterion_group, criterion_main};
use std::path::Path;
use std::process::Command;
-use wt_perf::{RepoConfig, create_repo, invalidate_caches_auto, isolate_cmd, setup_fake_remote};
+use worktrunk::testing::isolate_subprocess_env;
+use wt_perf::{RepoConfig, create_repo, invalidate_caches_auto, setup_fake_remote};
fn bench_first_output(c: &mut Criterion) {
let mut group = c.benchmark_group("first_output");
@@ -30,7 +31,7 @@ fn bench_first_output(c: &mut Criterion) {
let make_cmd = |args: &[&str]| {
let mut cmd = Command::new(binary);
cmd.args(args).current_dir(&repo_path);
- isolate_cmd(&mut cmd, None);
+ isolate_subprocess_env(&mut cmd, None);
cmd.env("WORKTRUNK_FIRST_OUTPUT", "1");
cmd
};
diff --git a/src/testing/mod.rs b/src/testing/mod.rs
index 029dd7ad4..bdd852e0c 100644
--- a/src/testing/mod.rs
+++ b/src/testing/mod.rs
@@ -268,6 +268,90 @@ pub const NULL_DEVICE: &str = "NUL";
#[cfg(not(windows))]
pub const NULL_DEVICE: &str = "/dev/null";
+/// `GIT_*` path variables that, if inherited as relative paths from the
+/// parent process (e.g. `GIT_DIR=.git` set by a git alias), redirect
+/// git's repository discovery away from a child's `current_dir`.
+///
+/// Stripped by [`scrub_git_path_vars`] before spawning a `git` subprocess
+/// that targets an explicit path. The same list backs the inherited-path
+/// normalization in [`crate::shell_exec`] (issue #1914) — keep it in sync
+/// with `INHERITED_GIT_PATH_VARS` there.
+pub const GIT_PATH_VARS: &[&str] = &[
+ "GIT_DIR",
+ "GIT_WORK_TREE",
+ "GIT_COMMON_DIR",
+ "GIT_INDEX_FILE",
+ "GIT_OBJECT_DIRECTORY",
+];
+
+/// Default user-config path for isolated subprocesses — points at a
+/// nonexistent file so wt treats it as "no config." Callers can override
+/// via the `user_config` parameter to [`isolate_subprocess_env`].
+pub const DEFAULT_ISOLATED_USER_CONFIG: &str = "/nonexistent/wt/config.toml";
+
+/// Default approvals path for isolated subprocesses — nonexistent file.
+const DEFAULT_ISOLATED_APPROVALS: &str = "/nonexistent/wt/approvals.toml";
+
+/// Default system-config path for isolated subprocesses. Uses the real
+/// XDG location so tests verify wt's XDG lookup path is exercised; the
+/// file doesn't actually exist on test/CI machines.
+const DEFAULT_ISOLATED_SYSTEM_CONFIG: &str = "/etc/xdg/worktrunk/config.toml";
+
+/// Prepare a subprocess to run with a clean wt environment.
+///
+/// Strips every `GIT_*` and `WORKTRUNK_*` from the parent env, plus
+/// `NO_COLOR` / `SHELL` / `PSModulePath`, then points the three
+/// `WORKTRUNK_*_PATH` env vars at known locations:
+///
+/// - `WORKTRUNK_CONFIG_PATH` ← `user_config` (or [`DEFAULT_ISOLATED_USER_CONFIG`])
+/// - `WORKTRUNK_SYSTEM_CONFIG_PATH` ← real XDG location (typically nonexistent on CI)
+/// - `WORKTRUNK_APPROVALS_PATH` ← nonexistent file
+///
+/// Shared by [`configure_cli_command`] (test-side, layers on test
+/// determinism: forced colors, fixed timestamps, log level, etc.) and
+/// bench callers (no extra layer — benches want realism). The two
+/// genuinely diverge in the *additions*, but the isolation baseline is
+/// identical.
+///
+/// Use on any wt subprocess that must not see host context. For `git`
+/// subprocesses, use [`configure_git_cmd`] instead.
+pub fn isolate_subprocess_env(cmd: &mut Command, user_config: Option<&Path>) {
+ for (key, _) in std::env::vars() {
+ if key.starts_with("GIT_") || key.starts_with("WORKTRUNK_") {
+ cmd.env_remove(&key);
+ }
+ }
+ cmd.env_remove("NO_COLOR");
+ cmd.env_remove("SHELL");
+ // PSModulePath being inherited triggers false PowerShell detection on
+ // CI environments where PowerShell Core is installed but not in use.
+ cmd.env_remove("PSModulePath");
+
+ cmd.env(
+ "WORKTRUNK_CONFIG_PATH",
+ user_config.unwrap_or(Path::new(DEFAULT_ISOLATED_USER_CONFIG)),
+ );
+ cmd.env(
+ "WORKTRUNK_SYSTEM_CONFIG_PATH",
+ DEFAULT_ISOLATED_SYSTEM_CONFIG,
+ );
+ cmd.env("WORKTRUNK_APPROVALS_PATH", DEFAULT_ISOLATED_APPROVALS);
+}
+
+/// `env_remove` the [`GIT_PATH_VARS`] from `cmd`. Call this on any `git`
+/// subprocess spawned with an explicit `current_dir`, so an inherited
+/// relative `GIT_DIR=.git` (from a git alias, hook, etc.) doesn't
+/// redirect discovery away from the path you set.
+///
+/// Strictly defensive when used downstream of [`isolate_subprocess_env`]
+/// (which already stripped these). Required when there's no upstream
+/// scrub — e.g. wt-perf shells out to `git` directly without a `wt` parent.
+pub fn scrub_git_path_vars(cmd: &mut Command) {
+ for var in GIT_PATH_VARS {
+ cmd.env_remove(var);
+ }
+}
+
/// Create a `wt` CLI command with standardized test environment settings.
///
/// The command has the following guarantees:
@@ -337,9 +421,10 @@ pub fn configure_completion_invocation_for_shell(cmd: &mut Command, words: &[&st
/// and is intended for cases where tests need to construct the command manually
/// (e.g., to execute shell pipelines).
///
-/// This is intentionally more thorough than `wt_perf::isolate_cmd()`:
-/// integration tests need full determinism (timestamps, locale, mock commands,
-/// wide COLUMNS for path display) while benchmarks only need host config stripped.
+/// Layers on top of [`isolate_subprocess_env`] (the env-strip + path
+/// baseline that benches use directly): tests additionally pin
+/// timestamps, locale, mock-command flags, and wide COLUMNS for
+/// deterministic snapshots, where benches want realism.
///
/// ## Related: `TestRepo::test_env_vars()`
///
@@ -351,38 +436,14 @@ pub fn configure_completion_invocation_for_shell(cmd: &mut Command, words: &[&st
/// - This function enables RUST_LOG=warn; PTY tests don't (too noisy in combined output)
/// - This function clears host GIT_*/WORKTRUNK_* vars; PTY tests start with clean env
pub fn configure_cli_command(cmd: &mut Command) {
- for (key, _) in std::env::vars() {
- if key.starts_with("GIT_") || key.starts_with("WORKTRUNK_") {
- cmd.env_remove(&key);
- }
- }
- // Prevent host environment from disabling ANSI in snapshots.
- // NO_COLOR can override CLICOLOR_FORCE in downstream output handling.
- cmd.env_remove("NO_COLOR");
- // Set to non-existent path to prevent loading user's real config.
- // Tests that need config should use TestRepo::configure_wt_cmd() which overrides this.
- // Note: env_remove above may cause insta-cmd to capture empty values in snapshots,
- // but correctness (isolating from host WORKTRUNK_* vars) trumps snapshot aesthetics.
- cmd.env("WORKTRUNK_CONFIG_PATH", "/nonexistent/test/config.toml");
- cmd.env(
- "WORKTRUNK_SYSTEM_CONFIG_PATH",
- "/etc/xdg/worktrunk/config.toml",
- );
- // `WORKTRUNK_PROJECT_CONFIG_PATH` is intentionally left unset so tests
- // can pick up `.config/wt.toml` in their own test repo via the default
- // lookup. Host leakage is prevented by the `WORKTRUNK_*` env_remove loop
- // above. Tests needing full project-config isolation (e.g., completion
- // tests that must not see this repo's aliases) should set it explicitly.
- cmd.env(
- "WORKTRUNK_APPROVALS_PATH",
- "/nonexistent/test/approvals.toml",
- );
- // Remove $SHELL to avoid platform-dependent diagnostic output (macOS has /bin/zsh,
- // Linux has /bin/bash). Tests that need SHELL should set it explicitly.
- cmd.env_remove("SHELL");
- // Remove PSModulePath to prevent false PowerShell detection on CI environments
- // where PowerShell Core is installed but not being used.
- cmd.env_remove("PSModulePath");
+ // Strip host context and set baseline `WORKTRUNK_*_PATH` defaults
+ // (all pointing at nonexistent or XDG paths). Tests needing real
+ // config should override after this call (e.g. via
+ // `TestRepo::configure_wt_cmd`). `WORKTRUNK_PROJECT_CONFIG_PATH` is
+ // intentionally not set so tests pick up `.config/wt.toml` in their
+ // own test repo via the default lookup; host leakage is prevented
+ // by the env-strip above.
+ isolate_subprocess_env(cmd, None);
// Disable auto PowerShell detection (tests that need it should set to "1")
cmd.env("WORKTRUNK_TEST_POWERSHELL_ENV", "0");
// Disable auto nushell detection (tests that need it should set to "1")
@@ -434,6 +495,11 @@ pub fn configure_cli_command(cmd: &mut Command) {
/// * `cmd` - The git Command to configure
/// * `git_config_path` - Path to git config file (use `/dev/null` or `NULL_DEVICE` for none)
pub fn configure_git_cmd(cmd: &mut Command, git_config_path: &Path) {
+ // Defensive: every existing caller is downstream of `configure_cli_command`
+ // (which already stripped these via `isolate_subprocess_env`), but a future
+ // test that spawns `git` from an unprepared parent shouldn't be vulnerable
+ // to an inherited relative `GIT_DIR` redirecting discovery.
+ scrub_git_path_vars(cmd);
cmd.env("GIT_CONFIG_GLOBAL", git_config_path);
cmd.env("GIT_CONFIG_SYSTEM", NULL_DEVICE);
cmd.env("GIT_AUTHOR_DATE", "2025-01-01T00:00:00Z");
@@ -449,6 +515,10 @@ pub fn configure_git_cmd(cmd: &mut Command, git_config_path: &Path) {
/// This is the `Cmd` equivalent of [`configure_git_cmd`]. Use this when building
/// git commands via the builder pattern (`Cmd::new("git")`).
pub fn configure_git_env(cmd: Cmd, git_config_path: &Path) -> Cmd {
+ // Defensive `GIT_*` path-var strip — see `configure_git_cmd` for rationale.
+ let cmd = GIT_PATH_VARS
+ .iter()
+ .fold(cmd, |acc, var| acc.env_remove(var));
cmd.env("GIT_CONFIG_GLOBAL", git_config_path)
.env("GIT_CONFIG_SYSTEM", NULL_DEVICE)
.env("GIT_AUTHOR_DATE", "2025-01-01T00:00:00Z")
diff --git a/tests/helpers/wt-perf/src/lib.rs b/tests/helpers/wt-perf/src/lib.rs
index 9837a185e..fd4b46c66 100644
--- a/tests/helpers/wt-perf/src/lib.rs
+++ b/tests/helpers/wt-perf/src/lib.rs
@@ -4,7 +4,10 @@
//! - Benchmark repository setup (used by `benches/list.rs`, `benches/time_to_first_output.rs`)
//! - Cache invalidation for cold benchmark runs
//! - Trace analysis utilities
-//! - Shared benchmark helpers (`isolate_cmd`, `run_git_ok`)
+//! - Shared benchmark helpers (`run_git`, `run_git_ok`, …)
+//!
+//! For wt-subprocess isolation, benches use
+//! [`worktrunk::testing::isolate_subprocess_env`] directly.
//!
//! # Library Usage
//!
@@ -22,9 +25,10 @@
//! See `wt-perf --help` for CLI usage.
use std::path::{Path, PathBuf};
+use std::process::Command;
use std::sync::OnceLock;
use tempfile::TempDir;
-use worktrunk::shell_exec::Cmd;
+use worktrunk::testing::{NULL_DEVICE, configure_git_cmd};
/// Lazy-initialized rust repo path.
static RUST_REPO: OnceLock<PathBuf> = OnceLock::new();
@@ -104,15 +108,20 @@ impl RepoConfig {
}
}
+/// Build a `git` command isolated from host context, with config
+/// redirected to `NULL_DEVICE`. Thin call-site wrapper around
+/// [`configure_git_cmd`] — every git invocation in this crate goes
+/// through here. Doesn't set `current_dir`; callers do that explicitly
+/// when they have a target.
+fn git_command() -> Command {
+ let mut cmd = Command::new("git");
+ configure_git_cmd(&mut cmd, Path::new(NULL_DEVICE));
+ cmd
+}
+
/// Run a git command in the given directory. Panics on failure.
pub fn run_git(path: &Path, args: &[&str]) {
- let output = Cmd::new("git")
- .args(args.iter().copied())
- .current_dir(path)
- .env("GIT_CONFIG_GLOBAL", "/dev/null")
- .env("GIT_CONFIG_SYSTEM", "/dev/null")
- .run()
- .unwrap();
+ let output = git_command().args(args).current_dir(path).output().unwrap();
assert!(
output.status.success(),
"Git command failed: {:?}\nstderr: {}\nstdout: {}\npath: {}",
@@ -125,47 +134,13 @@ pub fn run_git(path: &Path, args: &[&str]) {
/// Run a git command, returning whether it succeeded. Does not panic.
pub fn run_git_ok(path: &Path, args: &[&str]) -> bool {
- Cmd::new("git")
- .args(args.iter().copied())
+ git_command()
+ .args(args)
.current_dir(path)
- .env("GIT_CONFIG_GLOBAL", "/dev/null")
- .env("GIT_CONFIG_SYSTEM", "/dev/null")
- .run()
+ .output()
.is_ok_and(|o| o.status.success())
}
-/// Strip host environment from a benchmark command for isolation.
-///
-/// Removes `GIT_*`, `WORKTRUNK_*`, `SHELL`, and `NO_COLOR` env vars, then sets
-/// config/system/approvals paths. Pass a `user_config_path` to use a real config
-/// file (e.g., with hooks); `None` points at a nonexistent path (defaults only).
-///
-/// This is intentionally minimal compared to `tests/common::configure_cli_command()`:
-/// benchmarks need realistic timing without host config interference, while
-/// integration tests need full determinism (timestamps, locale, mock commands,
-/// snapshot filters). Coupling them would make benchmarks slower or tests flaky.
-pub fn isolate_cmd(cmd: &mut std::process::Command, user_config_path: Option<&Path>) {
- for (key, _) in std::env::vars() {
- if key.starts_with("GIT_") || key.starts_with("WORKTRUNK_") {
- cmd.env_remove(&key);
- }
- }
- cmd.env_remove("NO_COLOR");
- cmd.env(
- "WORKTRUNK_CONFIG_PATH",
- user_config_path.unwrap_or(Path::new("/nonexistent/bench/config.toml")),
- );
- cmd.env(
- "WORKTRUNK_SYSTEM_CONFIG_PATH",
- "/nonexistent/bench/system-config.toml",
- );
- cmd.env(
- "WORKTRUNK_APPROVALS_PATH",
- "/nonexistent/bench/approvals.toml",
- );
- cmd.env_remove("SHELL");
-}
-
/// Create a test repository from config.
///
/// Returns a `TempDir` containing the repo. The main worktree is at `temp.path().join("repo")`.
@@ -270,10 +245,10 @@ pub fn add_worktrees(config: &RepoConfig, repo_path: &Path) {
let branch = format!("feature-wt-{wt_num}");
let wt_path = parent_dir.join(format!("{repo_name}.{branch}"));
- let head_output = Cmd::new("git")
+ let head_output = git_command()
.args(["rev-parse", "HEAD"])
.current_dir(repo_path)
- .run()
+ .output()
.unwrap();
let base_commit = String::from_utf8_lossy(&head_output.stdout)
.trim()
@@ -313,16 +288,21 @@ pub fn setup_fake_remote(repo_path: &Path) {
let refs_dir = repo_path.join(".git/refs/remotes/origin");
std::fs::create_dir_all(&refs_dir).unwrap();
std::fs::write(refs_dir.join("HEAD"), "ref: refs/remotes/origin/main\n").unwrap();
- let head_sha = Cmd::new("git")
+ let head_sha = git_command()
.args(["rev-parse", "HEAD"])
.current_dir(repo_path)
- .run()
+ .output()
.unwrap();
std::fs::write(refs_dir.join("main"), head_sha.stdout).unwrap();
}
/// Invalidate caches for any repo (auto-detects worktrees).
///
+/// Resolves the git common directory from `repo_path/.git` — handling
+/// linked worktrees, where `.git` is a file holding a gitdir pointer
+/// rather than a directory — so the same cache is cleared regardless
+/// of which worktree of a repo `repo_path` names.
+///
/// Clears:
/// - Git's index (main + linked worktrees) — fsmonitor/stat warmup
/// - Commit graph (`objects/info/commit-graph*`)
@@ -339,42 +319,79 @@ pub fn setup_fake_remote(repo_path: &Path) {
/// `.git/wt/trash/`. These don't affect read-path performance, and benches
/// may rely on them (e.g., branch markers set during setup).
pub fn invalidate_caches_auto(repo_path: &Path) {
- let git_dir = repo_path.join(".git");
+ let Some(git_dir) = resolve_git_common_dir(repo_path) else {
+ return;
+ };
- // Remove main index
+ // Remove main index + every linked worktree's index.
let _ = std::fs::remove_file(git_dir.join("index"));
-
- // Remove all worktree indexes
- let worktrees_dir = git_dir.join("worktrees");
- if worktrees_dir.exists()
- && let Ok(entries) = std::fs::read_dir(&worktrees_dir)
- {
+ if let Ok(entries) = std::fs::read_dir(git_dir.join("worktrees")) {
for entry in entries.flatten() {
- let index = entry.path().join("index");
- let _ = std::fs::remove_file(index);
+ let _ = std::fs::remove_file(entry.path().join("index"));
}
}
- // Remove commit graph
+ // Commit graph: legacy single-file plus chained-graph dir.
let _ = std::fs::remove_file(git_dir.join("objects/info/commit-graph"));
let _ = std::fs::remove_dir_all(git_dir.join("objects/info/commit-graphs"));
- // Remove packed refs
let _ = std::fs::remove_file(git_dir.join("packed-refs"));
- // Remove worktrunk's persistent SHA-keyed caches (diff-stats, is-ancestor, etc.)
+ // All worktrunk persistent caches: every kind dir under wt/cache/.
let _ = std::fs::remove_dir_all(git_dir.join("wt/cache"));
- // Unset worktrunk's default-branch cache (git config). Uses `Cmd` to stay
- // consistent with how `Repository::clear_default_branch_cache` clears it.
- // Exit code 5 = key didn't exist (harmless); any other failure is ignored
- // because invalidation is best-effort.
- let _ = Cmd::new("git")
+ // Worktrunk's default-branch cache lives in git config; we have no
+ // safe way to edit that file ourselves (escaping rules), so shell
+ // out. Exit 5 = key absent (harmless); anything else is a real
+ // failure and we want it loud, since the bench's cold-cache
+ // invariant depends on this succeeding.
+ let result = git_command()
.args(["config", "--unset", "worktrunk.default-branch"])
.current_dir(repo_path)
- .env("GIT_CONFIG_GLOBAL", "/dev/null")
- .env("GIT_CONFIG_SYSTEM", "/dev/null")
- .run();
+ .output();
+ match result {
+ Ok(o) if o.status.success() => {}
+ Ok(o) if o.status.code() == Some(5) => {}
+ Ok(o) => eprintln!(
+ "wt-perf invalidate: `git config --unset worktrunk.default-branch` failed (exit {:?}): {}",
+ o.status.code(),
+ String::from_utf8_lossy(&o.stderr).trim()
+ ),
+ Err(e) => eprintln!("wt-perf invalidate: failed to spawn git: {e}"),
+ }
+}
+
+/// Resolve git's common directory for `repo_path` from the filesystem.
+///
+/// - Normal repo: `<repo>/.git` is a directory — use it directly.
+/// - Linked worktree: `<repo>/.git` is a file containing
+/// `gitdir: <main>/.git/worktrees/<name>`. The common dir is the
+/// parent of that worktree-private dir's parent.
+///
+/// Returns `None` for bare repos (no `.git` entry) or non-repo paths;
+/// the caller treats that as "nothing to invalidate."
+fn resolve_git_common_dir(repo_path: &Path) -> Option<PathBuf> {
+ let dot_git = repo_path.join(".git");
+ let file_type = std::fs::symlink_metadata(&dot_git).ok()?.file_type();
+
+ if file_type.is_dir() {
+ return Some(dot_git);
+ }
+ if !file_type.is_file() {
+ return None;
+ }
+
+ // `.git` is a gitdir pointer: `gitdir: <path>` (path may be relative
+ // to repo_path). Strip `worktrees/<name>` to reach the common dir.
+ let content = std::fs::read_to_string(&dot_git).ok()?;
+ let gitdir = content.lines().find_map(|l| l.strip_prefix("gitdir: "))?;
+ let pointed = PathBuf::from(gitdir.trim());
+ let pointed = if pointed.is_absolute() {
+ pointed
+ } else {
+ repo_path.join(pointed)
+ };
+ pointed.parent()?.parent().map(Path::to_path_buf)
}
/// Get or clone the rust-lang/rust repository for real-world benchmarks.
@@ -387,10 +404,10 @@ pub fn ensure_rust_repo() -> PathBuf {
let rust_repo = cache_dir.join("rust");
if rust_repo.exists() {
- let output = Cmd::new("git")
+ let output = git_command()
.args(["rev-parse", "HEAD"])
.current_dir(&rust_repo)
- .run();
+ .output();
if output.is_ok_and(|o| o.status.success()) {
eprintln!("Using cached rust repo at {}", rust_repo.display());
@@ -403,13 +420,13 @@ pub fn ensure_rust_repo() -> PathBuf {
std::fs::create_dir_all(&cache_dir).unwrap();
eprintln!("Cloning rust-lang/rust (this will take several minutes)...");
- let clone_output = Cmd::new("git")
+ let clone_output = git_command()
.args([
"clone",
"https://github.com/rust-lang/rust.git",
rust_repo.to_str().unwrap(),
])
- .run()
+ .output()
.unwrap();
assert!(clone_output.status.success(), "Failed to clone rust repo");
@@ -427,14 +444,14 @@ pub fn clone_rust_repo(temp: &TempDir) -> PathBuf {
let rust_repo = ensure_rust_repo();
let workspace_main = temp.path().join("repo");
- let clone_output = Cmd::new("git")
+ let clone_output = git_command()
.args([
"clone",
"--local",
rust_repo.to_str().unwrap(),
workspace_main.to_str().unwrap(),
])
- .run()
+ .output()
.unwrap();
assert!(
clone_output.status.success(),
@@ -453,10 +470,10 @@ pub fn clone_rust_repo(temp: &TempDir) -> PathBuf {
/// creates `feature-NNN` branches pointing at them. This reproduces the
/// GH #461 scenario where branch divergence depth (not count) drives cost.
pub fn add_history_spread_branches(repo_path: &Path, count: usize) {
- let log_output = Cmd::new("git")
+ let log_output = git_command()
.args(["log", "--oneline", "-n", "5000", "--format=%H"])
.current_dir(repo_path)
- .run()
+ .output()
.unwrap();
let log_str = String::from_utf8_lossy(&log_output.stdout);
let step = 5000 / count;
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap b/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
index 21632a655..76850c015 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
@@ -17,8 +17,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__ci_status__github_pr_failed.snap b/tests/snapshots/integration__integration_tests__ci_status__github_pr_failed.snap
index 382caaa97..d48940b9c 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__github_pr_failed.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__github_pr_failed.snap
@@ -11,10 +11,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_ci_rate_limit.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_ci_rate_limit.snap
index ab0e9e73d..69ada2519 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_ci_rate_limit.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_ci_rate_limit.snap
@@ -11,10 +11,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_pending.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_pending.snap
index ac48ca158..0783db8df 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_pending.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_pending.snap
@@ -11,10 +11,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_running.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_running.snap
index ac48ca158..0783db8df 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_running.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_running.snap
@@ -11,10 +11,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
diff --git a/tests/snapshots/integration__integration_tests__ci_status__stale_pr.snap b/tests/snapshots/integration__integration_tests__ci_status__stale_pr.snap
index 6274230cc..761aa0aa8 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__stale_pr.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__stale_pr.snap
@@ -11,10 +11,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap b/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap
index df9154b06..eaca50bbd 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap
@@ -17,8 +17,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap b/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
index 5d6de4440..34a06c914 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_approvals_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_approvals_clear.snap
index e26172494..111991736 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_approvals_clear.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_approvals_clear.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
index 075675f31..0d2de7525 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -17,8 +17,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
index 4c4be90e5..779dd2a90 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
index 5863eb58e..a4c861e9f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
@@ -17,8 +17,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_short.snap b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
index 0240378d1..32cfbe0bc 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_show.snap b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
index 51c8ecfb3..42f5970b3 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_show.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
@@ -17,8 +17,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state.snap b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
index 5fc48dd39..e9e48aa4f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
@@ -17,8 +17,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
index b04345866..59aa889c8 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
index ba3f00f41..8ee61a225 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
index 8e377e003..0e7a9a3a4 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
index 89874eef2..4030634a9 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
index 99285f1fb..0e03b36aa 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
index 8d0b324f8..4b0f3fa38 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
index 032352070..f3ed1b1f1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
@@ -18,8 +18,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
index fe06fc41b..70087c752 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
index 3b90b89bd..982f2bfea 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_short.snap b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
index 97b598bb6..f52ed6848 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
index bc0c6ada5..54a9bfedd 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_root.snap b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
index ca40236ec..b34f98e18 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
@@ -15,8 +15,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
index 519652e84..ee2df5b7d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
index 602d3ee31..aefd9867f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_no_args.snap b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
index 3d935d74b..eb4fd5654 100644
--- a/tests/snapshots/integration__integration_tests__help__help_no_args.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
@@ -14,8 +14,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index fe2285380..6d2aba9d0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
index d3f21ac85..e7bc42aa9 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_long.snap b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
index 19cb5187f..f2d9cc7d6 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
@@ -15,8 +15,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_short.snap b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
index 06d583cf9..9afb9abbe 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
@@ -15,8 +15,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_long.snap b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
index 6e51b9750..a8eff5c95 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_promote.snap b/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
index efdf76283..63dba4565 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
@@ -17,8 +17,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_short.snap b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
index f06f8bb6a..8e4176637 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
index f0b4d0be0..4dca8ae4d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
index 59918dcf3..3e148d1d6 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
@@ -16,8 +16,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__nested_subcommand_hook_pre_merge.snap b/tests/snapshots/integration__integration_tests__help__nested_subcommand_hook_pre_merge.snap
index 8435b93eb..1bb90d17a 100644
--- a/tests/snapshots/integration__integration_tests__help__nested_subcommand_hook_pre_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__nested_subcommand_hook_pre_merge.snap
@@ -15,8 +15,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__nested_subcommand_hook_pre_start.snap b/tests/snapshots/integration__integration_tests__help__nested_subcommand_hook_pre_start.snap
index c6557561d..5a7ce9f16 100644
--- a/tests/snapshots/integration__integration_tests__help__nested_subcommand_hook_pre_start.snap
+++ b/tests/snapshots/integration__integration_tests__help__nested_subcommand_hook_pre_start.snap
@@ -15,8 +15,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__nested_subcommand_step_commit.snap b/tests/snapshots/integration__integration_tests__help__nested_subcommand_step_commit.snap
index e4325f964..e50aa79f5 100644
--- a/tests/snapshots/integration__integration_tests__help__nested_subcommand_step_commit.snap
+++ b/tests/snapshots/integration__integration_tests__help__nested_subcommand_step_commit.snap
@@ -15,8 +15,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__nested_subcommand_step_squash.snap b/tests/snapshots/integration__integration_tests__help__nested_subcommand_step_squash.snap
index c8c4743d6..c0587ba63 100644
--- a/tests/snapshots/integration__integration_tests__help__nested_subcommand_step_squash.snap
+++ b/tests/snapshots/integration__integration_tests__help__nested_subcommand_step_squash.snap
@@ -15,8 +15,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__help__version.snap b/tests/snapshots/integration__integration_tests__help__version.snap
index 48c768e09..37574da6b 100644
--- a/tests/snapshots/integration__integration_tests__help__version.snap
+++ b/tests/snapshots/integration__integration_tests__help__version.snap
@@ -15,8 +15,8 @@ info:
RUST_LOG: warn
SHELL: ""
TERM: alacritty
- WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/wt/approvals.toml
+ WORKTRUNK_CONFIG_PATH: /nonexistent/wt/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
diff --git a/tests/snapshots/integration__integration_tests__list__quickstart_merge.snap b/tests/snapshots/integration__integration_tests__list__quickstart_merge.snap
index f0ef564fd..5193da3ad 100644
--- a/tests/snapshots/integration__integration_tests__list__quickstart_merge.snap
+++ b/tests/snapshots/integration__integration_tests__list__quickstart_merge.snap
@@ -11,10 +11,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
@@ -28,7 +33,7 @@ info:
TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
- WORKTRUNK_COMMIT__GENERATION__COMMAND: /private/var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp6TDTYE/mock-bin/llm
+ WORKTRUNK_COMMIT__GENERATION__COMMAND: /private/var/folders/v3/8k5q0_6j3_q6gl4h8czr66sh0000gn/T/.tmpW446k6/mock-bin/llm
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_DIRECTIVE_CD_FILE: "[DIRECTIVE_CD_FILE]"
WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
diff --git a/tests/snapshots/integration__integration_tests__merge__docs_merge_pre_merge_hook.snap b/tests/snapshots/integration__integration_tests__merge__docs_merge_pre_merge_hook.snap
index f70410bb4..3f79b105d 100644
--- a/tests/snapshots/integration__integration_tests__merge__docs_merge_pre_merge_hook.snap
+++ b/tests/snapshots/integration__integration_tests__merge__docs_merge_pre_merge_hook.snap
@@ -11,10 +11,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
index e23c5c768..60feb813d 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
@@ -12,10 +12,15 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C