radicle-heartwood-lfs/radicle-cli
Fintan Halpenny 7e3c7a7ae0
cli: Check for branch on checkout
The `rad patch checkout` command would blindly create a branch when
being executed. If there was a branch already existing and user had
committed to that branch, switched without updating the patch, and
then switched back, then they would lose the commit on that branch --
the original commit of the patch would be taken instead.

Fix this by first checking if the branch existed beforehand, and
setting the workspace to use that branch's commit.

Add a test to ensure that this works as expected.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-10-30 15:25:27 +01:00
..
examples cli: Check for branch on checkout 2023-10-30 15:25:27 +01:00
src cli: Check for branch on checkout 2023-10-30 15:25:27 +01:00
tests cli: Check for branch on checkout 2023-10-30 15:25:27 +01:00
Cargo.toml cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00