Skip to content

Commit 96dfec4

Browse files
committed
1 parent 4fa435b commit 96dfec4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

extensions/git/src/commands.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,12 +1397,16 @@ export class CommandCenter {
13971397
opts.signoff = true;
13981398
}
13991399

1400+
const smartCommitChanges = config.get<'all' | 'tracked'>('smartCommitChanges');
1401+
14001402
if (
14011403
(
14021404
// no changes
14031405
(noStagedChanges && noUnstagedChanges)
14041406
// or no staged changes and not `all`
14051407
|| (!opts.all && noStagedChanges)
1408+
// no staged changes and no tracked unstaged changes
1409+
|| (noStagedChanges && smartCommitChanges === 'tracked' && repository.workingTreeGroup.resourceStates.every(r => r.type === Status.UNTRACKED))
14061410
)
14071411
&& !opts.empty
14081412
) {
@@ -1416,7 +1420,7 @@ export class CommandCenter {
14161420
return false;
14171421
}
14181422

1419-
if (opts.all && config.get<'all' | 'tracked'>('smartCommitChanges') === 'tracked') {
1423+
if (opts.all && smartCommitChanges === 'tracked') {
14201424
opts.all = 'tracked';
14211425
}
14221426

0 commit comments

Comments
 (0)