From d0fdd0b6a3e12e6a402055df22a2dedd494bc730 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Wed, 2 Aug 2023 11:17:16 +0200 Subject: [PATCH] cli: Make `rad patch checkout` idempotent Fixes an error when you checkout an already checked out patch. --- radicle-cli/src/commands/patch/checkout.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radicle-cli/src/commands/patch/checkout.rs b/radicle-cli/src/commands/patch/checkout.rs index be270074..68ac2ecc 100644 --- a/radicle-cli/src/commands/patch/checkout.rs +++ b/radicle-cli/src/commands/patch/checkout.rs @@ -26,7 +26,7 @@ pub fn run( let commit = find_patch_commit(&patch, &patch_branch, stored, working)?; // Create patch branch and switch to it. - working.branch(patch_branch.as_str(), &commit, false)?; + working.branch(patch_branch.as_str(), &commit, true)?; working.checkout_tree(commit.as_object(), None)?; working.set_head(&git::refs::workdir::branch(&patch_branch))?;