From 02a69e85c0ce1cd9ca02365b89d2ccdb119712ee Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sun, 31 Jul 2016 16:06:05 -0700 Subject: [PATCH] Resolves #385 -- validate no amend options --- src/js/git/commands.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/git/commands.js b/src/js/git/commands.js index 1caff0ba..46e27e8e 100644 --- a/src/js/git/commands.js +++ b/src/js/git/commands.js @@ -153,8 +153,13 @@ var commandConfig = { msg = args[0]; } + if (commandOptions['--amend']) { + args = commandOptions['--amend']; + command.validateArgBounds(args, 0, 0, '--amend'); + } + var newCommit = engine.commit({ - isAmend: commandOptions['--amend'] + isAmend: !!commandOptions['--amend'] }); if (msg) { msg = msg @@ -267,7 +272,7 @@ var commandConfig = { engine.pull({ source: source, destination: destination, - isRebase: commandOptions['--rebase'] + isRebase: !!commandOptions['--rebase'] }); } },