Set target branch when chosen

This commit is contained in:
tidy-dev 2022-02-09 07:27:47 -05:00
parent e96d8188e5
commit 0a5c1edd31
3 changed files with 15 additions and 2 deletions

View file

@ -2874,7 +2874,7 @@ export class App extends React.Component<IAppProps, IAppState> {
branchCreated: false,
commits,
},
tip.branch,
null,
commits,
tip.branch.tip.sha
)

View file

@ -3192,6 +3192,19 @@ export class Dispatcher {
return this.appStore._setMultiCommitOperationStep(repository, step)
}
/** Set the multi commit operation target branch */
public setMultiCommitOperationTargetBranch(
repository: Repository,
targetBranch: Branch
): void {
this.repositoryStateManager.updateMultiCommitOperationState(
repository,
() => ({
targetBranch,
})
)
}
/** Set cherry-pick branch created state */
public setCherryPickBranchCreated(
repository: Repository,

View file

@ -160,7 +160,7 @@ export abstract class CherryPick extends BaseMultiCommitOperation {
}
const { commits, sourceBranch } = operationDetail
dispatcher.setMultiCommitOperationTargetBranch(repository, targetBranch)
dispatcher.setCherryPickBranchCreated(repository, false)
dispatcher.cherryPick(repository, targetBranch, commits, sourceBranch)
}