cli: Make `rad patch checkout` idempotent

Fixes an error when you checkout an already checked out patch.
This commit is contained in:
cloudhead 2023-08-02 11:17:16 +02:00
parent b953e9f6b5
commit d0fdd0b6a3
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -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))?;