test(issue-17): herdr 0.9.3 keeps a removed directory as the restored pane's cwd
test_b_only_the_resumed_sessions_restored_shell_is_closed asserted that a pane whose directory was removed comes back in $HOME. That is herdr 0.9.1; herdr 0.9.3 keeps the old path. The cwd check now takes either, with a note on which version does what; closing never looked at the cwd. herdr_restore.py's docstring said the same "$HOME when that directory is gone" and now names both versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCGpJXhSZasJLU38ksDghe
This commit is contained in:
1 parent
56d0bfda54
commit
25c99704f2
2 files changed
+8
-4
No files matched your search
@@ -264,7 +264,7 @@ def test_b_only_the_resumed_sessions_restored_shell_is_closed(rig):
|
||||
rig.run_agent(rig.new_pane(rig.root / f"ws{k}", k), ids[k])
|
||||
rig.new_pane(rig.root / "wsU", "U") # a user's plain shell: no agent_session
|
||||
rig.crash(*ids.values())
|
||||
shutil.rmtree(rig.root / "wsY") # a removed worktree: restored into $HOME
|
||||
shutil.rmtree(rig.root / "wsY") # a removed worktree: still restored (cwd below)
|
||||
|
||||
before = rig.restores()
|
||||
rig.start_via_shim()
|
||||
@@ -272,7 +272,9 @@ def test_b_only_the_resumed_sessions_restored_shell_is_closed(rig):
|
||||
rig.run_agent(_pane_with(rig, ids["Z"])["pane_id"], ids["Z"]) # running again
|
||||
rig.hd("pane", "run", _pane_with(rig, ids["X2"])["pane_id"], "sleep 60") # busy shell
|
||||
time.sleep(1)
|
||||
assert _pane_with(rig, ids["Y"])["cwd"] == str(rig.root)
|
||||
# Y's directory is gone: herdr 0.9.1 restores the pane into $HOME (rig.root),
|
||||
# 0.9.3 keeps the old path. Closing does not look at the cwd either way.
|
||||
assert _pane_with(rig, ids["Y"])["cwd"] in (str(rig.root), str(rig.root / "wsY"))
|
||||
n = len(rig.panes())
|
||||
|
||||
for k in ("Z", "X2"):
|
||||
|
||||
Reference in new issue
Block a user