|
@ -343,6 +343,12 @@ export class WorktreeGitCommand extends QuickCommand { |
|
|
state.confirm = true; |
|
|
state.confirm = true; |
|
|
this.canSkipConfirmOverride = undefined; |
|
|
this.canSkipConfirmOverride = undefined; |
|
|
|
|
|
|
|
|
|
|
|
const isRemoteBranch = state.reference?.refType === 'branch' && state.reference?.remote; |
|
|
|
|
|
if (isRemoteBranch && !state.flags.includes('-b')) { |
|
|
|
|
|
state.flags.push('-b'); |
|
|
|
|
|
state.createBranch = GitReference.getNameWithoutRemote(state.reference); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (state.flags.includes('-b') && state.createBranch == null) { |
|
|
if (state.flags.includes('-b') && state.createBranch == null) { |
|
|
const result = yield* inputBranchNameStep(state, context, { |
|
|
const result = yield* inputBranchNameStep(state, context, { |
|
|
placeholder: 'Please provide a name for the new branch', |
|
|
placeholder: 'Please provide a name for the new branch', |
|
@ -558,7 +564,10 @@ export class WorktreeGitCommand extends QuickCommand { |
|
|
|
|
|
|
|
|
const recommendedUri = |
|
|
const recommendedUri = |
|
|
state.reference != null |
|
|
state.reference != null |
|
|
? Uri.joinPath(recommendedRootUri, ...state.reference.name.replace(/\\/g, '/').split('/')) |
|
|
|
|
|
|
|
|
? Uri.joinPath( |
|
|
|
|
|
recommendedRootUri, |
|
|
|
|
|
...GitReference.getNameWithoutRemote(state.reference).replace(/\\/g, '/').split('/'), |
|
|
|
|
|
) |
|
|
: recommendedRootUri; |
|
|
: recommendedRootUri; |
|
|
const recommendedFriendlyPath = truncateLeft(GitWorktree.getFriendlyPath(recommendedUri), 65); |
|
|
const recommendedFriendlyPath = truncateLeft(GitWorktree.getFriendlyPath(recommendedUri), 65); |
|
|
|
|
|
|
|
|