Merge branch 'master', commit 'refs/pull/56048/head' of github.com:Microsoft/vscode into pr/56048

This commit is contained in:
Joao Moreno
2018-09-12 15:37:41 +02:00
5 changed files with 33 additions and 0 deletions

View File

@@ -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);

View File

@@ -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 || '' });

View File

@@ -395,6 +395,7 @@ export interface CommitOptions {
amend?: boolean;
signoff?: boolean;
signCommit?: boolean;
empty?: boolean;
}
export interface GitResourceGroup extends SourceControlResourceGroup {