fix default path bug related to branch prefix (#258709)

* fix default path bug related to branch prefix

* remove branch prefix first, then get last component

* replace / with -

* clean up
This commit is contained in:
Christy 😺
2025-07-30 08:02:35 -07:00
committed by GitHub
parent 218110854f
commit 20724f79ba
+3 -4
View File
@@ -3455,10 +3455,9 @@ export class CommandCenter {
commitish = choice.refName;
}
const worktreeName = (branch ?? commitish).startsWith(branchPrefix)
? (branch ?? commitish).substring(branchPrefix.length)
: (branch ?? commitish);
const worktreeName = ((branch ?? commitish).startsWith(branchPrefix)
? (branch ?? commitish).substring(branchPrefix.length).replace(/\//g, '-')
: (branch ?? commitish).replace(/\//g, '-'));
// If user selects folder button, they manually select the worktree path through folder picker
const getWorktreePath = async (): Promise<string | undefined> => {