mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Merge branch 'master', commit 'refs/pull/56048/head' of github.com:Microsoft/vscode into pr/56048
This commit is contained in:
@@ -1086,10 +1086,13 @@ export class CommandCenter {
|
||||
}
|
||||
|
||||
if (
|
||||
(
|
||||
// no changes
|
||||
(noStagedChanges && noUnstagedChanges)
|
||||
// or no staged changes and not `all`
|
||||
|| (!opts.all && noStagedChanges)
|
||||
)
|
||||
&& !opts.empty
|
||||
) {
|
||||
window.showInformationMessage(localize('no changes', "There are no changes to commit."));
|
||||
return false;
|
||||
@@ -1134,6 +1137,11 @@ export class CommandCenter {
|
||||
}
|
||||
}
|
||||
|
||||
@command('git.commitEmpty', { repository: true})
|
||||
async commit(repository: Repository): Promise<void> {
|
||||
await this.commitWithAnyInput(repository, { empty: true });
|
||||
}
|
||||
|
||||
@command('git.commit', { repository: true })
|
||||
async commit(repository: Repository): Promise<void> {
|
||||
await this.commitWithAnyInput(repository);
|
||||
|
||||
@@ -958,6 +958,9 @@ export class Repository {
|
||||
if (opts.signCommit) {
|
||||
args.push('-S');
|
||||
}
|
||||
if (opts.empty) {
|
||||
args.push('--allow-empty');
|
||||
}
|
||||
|
||||
try {
|
||||
await this.run(args, { input: message || '' });
|
||||
|
||||
@@ -395,6 +395,7 @@ export interface CommitOptions {
|
||||
amend?: boolean;
|
||||
signoff?: boolean;
|
||||
signCommit?: boolean;
|
||||
empty?: boolean;
|
||||
}
|
||||
|
||||
export interface GitResourceGroup extends SourceControlResourceGroup {
|
||||
|
||||
Reference in New Issue
Block a user