mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
remove some indenting from #1104
This commit is contained in:
parent
6e88757bc4
commit
2da4d88737
1 changed files with 21 additions and 26 deletions
|
@ -765,7 +765,7 @@ var commandConfig = {
|
||||||
// git push is pretty complex in terms of
|
// git push is pretty complex in terms of
|
||||||
// the arguments it wants as well... get ready!
|
// the arguments it wants as well... get ready!
|
||||||
var generalArgs = command.getGeneralArgs();
|
var generalArgs = command.getGeneralArgs();
|
||||||
|
|
||||||
// put the commandOption of delete back in the generalArgs
|
// put the commandOption of delete back in the generalArgs
|
||||||
// as it is a flag option
|
// as it is a flag option
|
||||||
if(isDelete) {
|
if(isDelete) {
|
||||||
|
@ -932,34 +932,29 @@ var commandConfig = {
|
||||||
var generalArgs = command.getGeneralArgs();
|
var generalArgs = command.getGeneralArgs();
|
||||||
var commandOptions = command.getOptionsMap();
|
var commandOptions = command.getOptionsMap();
|
||||||
|
|
||||||
{
|
let createOption = commandOptions['-c'] ? commandOptions['-c'] : commandOptions['--create'];
|
||||||
let createOption = commandOptions['-c'] ? commandOptions['-c'] : commandOptions['--create'];
|
if (createOption) {
|
||||||
if (createOption) {
|
// the user is really trying to just make a
|
||||||
// the user is really trying to just make a
|
// branch and then switch to it. so first:
|
||||||
// branch and then switch to it. so first:
|
let args = createOption.concat(generalArgs)
|
||||||
let args = createOption.concat(generalArgs)
|
command.twoArgsImpliedHead(args, '-c');
|
||||||
command.twoArgsImpliedHead(args, '-c');
|
|
||||||
|
|
||||||
let validId = engine.validateBranchName(args[0]);
|
let validId = engine.validateBranchName(args[0]);
|
||||||
engine.branch(validId, args[1]);
|
engine.branch(validId, args[1]);
|
||||||
engine.checkout(validId);
|
engine.checkout(validId);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
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, sfc);
|
||||||
|
|
||||||
{
|
let validId = engine.validateBranchName(args[0]);
|
||||||
let sfc = '-C';
|
engine.forceBranch(validId, args[1]);
|
||||||
let lfc = '--force-create';
|
engine.checkout(validId);
|
||||||
let fcOption = commandOptions[sfc] ? commandOptions[sfc] : commandOptions[lfc];
|
return;
|
||||||
if (fcOption) {
|
|
||||||
let args = fcOption.concat(generalArgs);
|
|
||||||
command.twoArgsImpliedHead(args, sfc);
|
|
||||||
|
|
||||||
let validId = engine.validateBranchName(args[0]);
|
|
||||||
engine.forceBranch(validId, args[1]);
|
|
||||||
engine.checkout(validId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commandOptions['-']) {
|
if (commandOptions['-']) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue