Update commands.js

Being a popular option in Github to squash and merge, it would be interesting to add support for this option
This commit is contained in:
Cesar Costas 2022-11-29 23:01:57 +00:00 committed by GitHub
parent 67c28028fe
commit 4471fc9595
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -559,7 +559,8 @@ var commandConfig = {
merge: { merge: {
regex: /^git +merge($|\s)/, regex: /^git +merge($|\s)/,
options: [ options: [
'--no-ff' '--no-ff',
'--squash'
], ],
execute: function(engine, command) { execute: function(engine, command) {
var commandOptions = command.getOptionsMap(); var commandOptions = command.getOptionsMap();
@ -568,7 +569,10 @@ var commandConfig = {
var newCommit = engine.merge( var newCommit = engine.merge(
generalArgs[0], generalArgs[0],
{ noFF: !!commandOptions['--no-ff'] } {
noFF: !!commandOptions['--no-ff'],
squash: !!commandOptions['--squash']
}
); );
if (newCommit === undefined) { if (newCommit === undefined) {