# agent: Support remote archive thread git operations \(\#54001\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d60b55675b7a8a06d8a0ac35cd9e59cf2acb1d77

Requested commit: d60b55675b7a8a06d8a0ac35cd9e59cf2acb1d77

Commit: d60b55675b7a8a06d8a0ac35cd9e59cf2acb1d77

Tree: 2d1f1d540b4bfdd0c73f029148c41ec40a757c28

Author: Anthony Eid

Committer: GitHub

## Message

```
agent: Support remote archive thread git operations (#54001)

### Summary

This PR implements remote support for git store operations that the
sidebar's archive thread checkpoint/restore featured relied on. This was
the second to last blocker for remote usage of this feature.

I also made a shared backend between `update_ref` and `delete_ref`
called `edit_ref` because they run the same git command and this allowed
for some code unification.

#### Remote Git Operations 
- `Repository::update_ref`
- `Repository::delete_ref`
- `Repository::repair_worktrees`
- `Repository::create_archive_checkpoint`
- `Repository::restore_archive_checkpoint`


#### Follow up

`agent_ui::thread_worktree_archive::find_or_create_repository` needs to
be made aware of the remote machine that the repository it's searching
for is on. Once that is completed, we can get the correct repo when
archiving a remote thread and the flow should work without any problems.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
```

## Parents

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

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