test(config): assert --print leaves the linked worktree's config unmigrated

The write-freedom assertion checked the main worktree's .config/wt.toml,
which the command never touches when run from a linked worktree:
project_config_path() resolves against the current worktree root, so the
file read — and the one a regression would rewrite — is
<feature-print>/.config/wt.toml. Assert on that copy too.
This commit is contained in:
worktrunk-bot
2026-09-06 07:03:58 +00:00
parent b2c1e4102a
commit d60ee5b52e
+6
View File
@@ -5333,6 +5333,12 @@ fn test_config_update_print_emits_project_config_from_linked_worktree(repo: Test
"--print must keep stderr empty for pipe-friendliness, got: {}",
String::from_utf8_lossy(&output.stderr)
);
assert!(
fs::read_to_string(feature_path.join(".config").join("wt.toml"))
.unwrap()
.contains("{{ main_worktree }}"),
"--print must leave the linked worktree's config — the file it actually read — unmigrated"
);
assert_eq!(
fs::read_to_string(&project_config_path).unwrap(),
before,