diff --git a/justfile b/justfile index 3cc1862..9af701d 100644 --- a/justfile +++ b/justfile @@ -796,10 +796,10 @@ cherry-pick-commits-into-new-worktree *commits: if gum confirm 'Use -x? Will append a line that says "(cherry picked from commit ...)"'; then commits=(-x "${commits[@]}") fi - cd "$( - just _new_worktree "$(just _a_wt_type)" "$(gum input --placeholder="Branch name?" --value="$proposed_name")" - )" - git cherry-pick "${commits[@]}" + worktree="$(just _new_worktree "$(just _a_wt_type)" "$(gum input --placeholder="Branch name?" --value="$proposed_name")")" + [[ -n "$worktree" ]] + cd "$worktree" + git cherry-pick "${commits[@]}" || echo >&2 "ERROR: Cherry pick failed!" exec just _enter_interactive_shell pop-commits-to-new-worktree $commits=`cd "$invokedir"; just _some_commits`: