Disable first-work folder rename (#5535)
This commit is contained in:
parent
7e1c4ee929
commit
d625079c4d
|
|
@ -103,6 +103,17 @@ describe('maybeAutoRenameBranchOnFirstWork', () => {
|
|||
expect(renameWorktreeFolder).toHaveBeenCalledWith(WORKTREE_ID, 'fix-auth')
|
||||
})
|
||||
|
||||
it('keeps branch and display rename working when folder rename is disabled', async () => {
|
||||
const { deps, onRenamed, setDisplayName } = makeDeps({ renameWorktreeFolder: undefined })
|
||||
await maybeAutoRenameBranchOnFirstWork(workingEvent(), deps)
|
||||
expect(gitExecFileAsyncMock).toHaveBeenCalledWith(
|
||||
['branch', '-m', 'you/fix-auth'],
|
||||
expect.objectContaining({ cwd: '/repo/wt' })
|
||||
)
|
||||
expect(setDisplayName).toHaveBeenCalledWith(WORKTREE_ID, 'Fix auth')
|
||||
expect(onRenamed).toHaveBeenCalledWith(REPO_ID)
|
||||
})
|
||||
|
||||
it('skips the redundant branch-rename notify when the folder rename succeeded', async () => {
|
||||
// The folder rename already pushed a worktrees:changed carrying the id mapping,
|
||||
// so onRenamed would only trigger a second, redundant renderer re-list.
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ if (appImageCliRedirect.redirected) {
|
|||
// worktree id change via migrateWorktreeIdentity + a rename-aware worktrees:changed
|
||||
// handler, so an old->new id change is no longer mistaken for a deletion. Flip off
|
||||
// to disable the on-disk move (branch + display rename still happen) if needed.
|
||||
const ENABLE_FIRST_WORK_FOLDER_RENAME = true
|
||||
const ENABLE_FIRST_WORK_FOLDER_RENAME = false
|
||||
|
||||
// Why: the store/runtime singletons live here in index.ts; injecting them keeps
|
||||
// the rename orchestrator free of module-level state and unit-testable.
|
||||
|
|
|
|||
Loading…
Reference in New Issue