Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
remote-helper: allow patch creation from detached HEAD
Merged fintohaps opened 1 year ago

The patch creation flow would be partially interrupted when creating a patch via a detached HEAD state. The creation of an upstream branch would fail since there is no branch to set an upstream for. It would result in the following error:

✓ Patch 6035d2f582afbe01ff23ea87528ae523d76875b6 opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
 ! [remote rejected] HEAD -> refs/patches (git: reference 'HEAD' is neither a local nor a remote branch.; class=Invalid (3))
error: failed to push some refs to 'rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi'

To fix this, the reference that’s resolved is checked to see if it a local branch. If not, it will return early.

The behaviour is tested in the rad-patch-detached-head example.

fintohaps opened with revision 50e1f0cb on base a04381f4 +66 -0 1 year ago

The patch creation flow would be partially interrupted when creating a patch via a detached HEAD state. The creation of an upstream branch would fail since there is no branch to set an upstream for. It would result in the following error:

✓ Patch 6035d2f582afbe01ff23ea87528ae523d76875b6 opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
 ! [remote rejected] HEAD -> refs/patches (git: reference 'HEAD' is neither a local nor a remote branch.; class=Invalid (3))
error: failed to push some refs to 'rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi'

To fix this, the reference that’s resolved is checked to see if it a local branch. If not, it will return early.

The behaviour is tested in the rad-patch-detached-head example.

did:key:z6MksFqX...wzpT pushed revision 2 eca42ec5 on base 1c46f195 +66 -0 1 year ago

Rebase.

did:key:z6MksFqX...wzpT merged revision eca42ec5 at dc34eafd 1 year ago