Context
Reported by haacked in Slack. Edge case but worth fixing.
Problem
When a workspace's worktree has been deleted by an external process (e.g. manual cleanup on the command line), clicking the archive button causes the task to flash, it briefly disappears then reappears. The archive operation fails because it tries to capture a checkpoint in a directory that is no longer a git repository.
Error from dev console:
Failed to archive task TRPCClientError: Failed to capture checkpoint: fatal: not a git repository (or any of the parent directories): .git
Expected behavior
If the worktree no longer exists or is not a valid git repository, the archive should skip the checkpoint step and continue with the remaining archive steps.
Steps to reproduce
- Have a workspace with an associated worktree
- Delete the worktree externally (e.g.
rm -rf the worktree directory)
- Click the archive button on the workspace
- Observe the task flashes and does not archive
Context
Reported by haacked in Slack. Edge case but worth fixing.
Problem
When a workspace's worktree has been deleted by an external process (e.g. manual cleanup on the command line), clicking the archive button causes the task to flash, it briefly disappears then reappears. The archive operation fails because it tries to capture a checkpoint in a directory that is no longer a git repository.
Error from dev console:
Expected behavior
If the worktree no longer exists or is not a valid git repository, the archive should skip the checkpoint step and continue with the remaining archive steps.
Steps to reproduce
rm -rfthe worktree directory)