mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
Add git switch --force-create
This commit is contained in:
parent
86bf7c7a71
commit
199f0219c4
2 changed files with 21 additions and 3 deletions
|
@ -925,6 +925,7 @@ var commandConfig = {
|
|||
'-c',
|
||||
'--create',
|
||||
'-C',
|
||||
'--force-create',
|
||||
'-'
|
||||
],
|
||||
execute: function(engine, command) {
|
||||
|
@ -947,11 +948,12 @@ var commandConfig = {
|
|||
}
|
||||
|
||||
{
|
||||
let fc = '-C';
|
||||
let fcOption = commandOptions[fc];
|
||||
let sfc = '-C';
|
||||
let lfc = '--force-create';
|
||||
let fcOption = commandOptions[sfc] ? commandOptions[sfc] : commandOptions[lfc];
|
||||
if (fcOption) {
|
||||
let args = fcOption.concat(generalArgs);
|
||||
command.twoArgsImpliedHead(args, fc);
|
||||
command.twoArgsImpliedHead(args, sfc);
|
||||
|
||||
let validId = engine.validateBranchName(args[0]);
|
||||
engine.forceBranch(validId, args[1]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue