# Clean up orphaned files on git worktree creation failure \(\#53287\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e7ba1715688433c92586e7493decc11e424e804e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e7ba1715688433c92586e7493decc11e424e804e

Requested commit: e7ba1715688433c92586e7493decc11e424e804e

Commit: e7ba1715688433c92586e7493decc11e424e804e

Tree: 3bb0063d54e9ff62289234056775aaab279ef361

Author: Richard Feldman

Committer: GitHub

## Message

```
Clean up orphaned files on git worktree creation failure (#53287)

Update `await_and_rollback_on_failure` in `agent_panel.rs` to
comprehensively clean up both git metadata and filesystem artifacts when
worktree creation fails.

Release Notes:

- Clean up files and git metadata when worktree creation fails during
new agent thread setup.
```

## Parents

- [e25885bbe6e3ff7af565756290173a2f60b7acc8](https://git.cafe/gitcafe/zed/commit/e25885bbe6e3ff7af565756290173a2f60b7acc8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e7ba1715688433c92586e7493decc11e424e804e?format=markdown)
