Skip to content

Commit

Permalink
Git - fix commit flow regression (#220991)
Browse files Browse the repository at this point in the history
  • Loading branch information
lszomoru authored Jul 8, 2024
1 parent e5da006 commit d0f0de5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions extensions/git/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2063,7 +2063,7 @@ export class CommandCenter {
promptToSaveFilesBeforeCommit = 'never';
}

const enableSmartCommit = config.get<boolean>('enableSmartCommit') === true;
let enableSmartCommit = config.get<boolean>('enableSmartCommit') === true;
const enableCommitSigning = config.get<boolean>('enableCommitSigning') === true;
let noStagedChanges = repository.indexGroup.resourceStates.length === 0;
let noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0;
Expand Down Expand Up @@ -2119,12 +2119,16 @@ export class CommandCenter {
const pick = await window.showWarningMessage(message, { modal: true }, yes, always, never);

if (pick === always) {
enableSmartCommit = true;
config.update('enableSmartCommit', true, true);
} else if (pick === never) {
config.update('suggestSmartCommit', false, true);
return;
} else if (pick !== yes) {
return; // do not commit on cancel
} else if (pick === yes) {
enableSmartCommit = true;
} else {
// Cancel
return;
}
}

Expand Down

0 comments on commit d0f0de5

Please sign in to comment.