mirror of
https://github.com/kahole/edamagit.git
synced 2024-10-26 09:00:54 +03:00
Merge pull request #290 from bezbac/develop
Adds support for `magit-branch-spinoff`
This commit is contained in:
commit
cce3727048
@ -15,7 +15,7 @@ const branchingCommands = [
|
||||
{ label: 'c', description: 'Checkout new branch', action: checkoutNewBranch },
|
||||
// { label: "w", description: "Checkout new worktree", action: checkout },
|
||||
// { label: "y", description: "Checkout pull-request", action: checkout },
|
||||
// { label: "s", description: "Create new spin-off", action: createNewSpinoff },
|
||||
{ label: 's', description: 'Create new spin-off', action: createNewSpinoff },
|
||||
{ label: 'n', description: 'Create new branch', action: createNewBranch },
|
||||
// { label: "W", description: "Create new worktree", action: checkout },
|
||||
// { label: "Y", description: "Create from pull-request", action: checkout },
|
||||
@ -201,3 +201,19 @@ async function _createBranch({ repository }: MenuState, checkout: boolean) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function createNewSpinoff({ repository }: MenuState) {
|
||||
const newBranchName = await window.showInputBox({
|
||||
prompt: 'Name for new branch',
|
||||
});
|
||||
|
||||
if (newBranchName && newBranchName.length > 0) {
|
||||
const args = ['checkout', '-B', newBranchName];
|
||||
return gitRun(repository.gitRepository, args);
|
||||
} else {
|
||||
window.setStatusBarMessage(
|
||||
'No name given for new branch',
|
||||
Constants.StatusMessageDisplayTimeout
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user