This commit is contained in:
Joao Moreno 2020-02-27 09:58:01 +01:00
parent 4fa435b69b
commit 96dfec43ee
No known key found for this signature in database
GPG key ID: 6B67DA2A61830D0A

View file

@ -1397,12 +1397,16 @@ export class CommandCenter {
opts.signoff = true;
}
const smartCommitChanges = config.get<'all' | 'tracked'>('smartCommitChanges');
if (
(
// no changes
(noStagedChanges && noUnstagedChanges)
// or no staged changes and not `all`
|| (!opts.all && noStagedChanges)
// no staged changes and no tracked unstaged changes
|| (noStagedChanges && smartCommitChanges === 'tracked' && repository.workingTreeGroup.resourceStates.every(r => r.type === Status.UNTRACKED))
)
&& !opts.empty
) {
@ -1416,7 +1420,7 @@ export class CommandCenter {
return false;
}
if (opts.all && config.get<'all' | 'tracked'>('smartCommitChanges') === 'tracked') {
if (opts.all && smartCommitChanges === 'tracked') {
opts.all = 'tracked';
}