mirror of
https://github.com/kahole/edamagit.git
synced 2024-09-11 07:15:31 +03:00
adds support for magit-branch-spinoff
This commit is contained in:
parent
5254658934
commit
1a323ef4fa
@ -15,7 +15,7 @@ const branchingCommands = [
|
|||||||
{ label: 'c', description: 'Checkout new branch', action: checkoutNewBranch },
|
{ label: 'c', description: 'Checkout new branch', action: checkoutNewBranch },
|
||||||
// { label: "w", description: "Checkout new worktree", action: checkout },
|
// { label: "w", description: "Checkout new worktree", action: checkout },
|
||||||
// { label: "y", description: "Checkout pull-request", 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: 'n', description: 'Create new branch', action: createNewBranch },
|
||||||
// { label: "W", description: "Create new worktree", action: checkout },
|
// { label: "W", description: "Create new worktree", action: checkout },
|
||||||
// { label: "Y", description: "Create from pull-request", 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