cli: Use git push to open or update patches

This adds the ability to the git-remote-helper to open and update
patches via a `git push` to the magic ref `refs/patches` and
`refs/heads/patches/<patch-id>`.

The main change is that we had to move away from offering the `connect`
capability in the remote helper, to offering `push` and `fetch`
individually.

To get a feel for how this works, see the `rad-patch-via-push.md`
example.
This commit is contained in:
Alexis Sellier
2023-05-12 12:22:08 +02:00
parent f8ee109aaa
commit fd1237b2db
25 changed files with 1198 additions and 131 deletions
+3 -2
View File
@@ -60,11 +60,12 @@ pub fn run(
let (target_ref, target_oid) = get_merge_target(storage, &head_branch)?;
if head_branch.upstream().is_err() {
// TODO(cloudhead): Disable this when invoked from remote helper.
radicle::git::set_upstream(
workdir,
&radicle::rad::REMOTE_NAME,
&*radicle::rad::REMOTE_NAME,
branch_name(&head_branch)?,
&head_branch_name,
head_branch_name,
)?;
}