mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
fixes #84274
This commit is contained in:
parent
655bd8f303
commit
fd091abb85
|
@ -1608,6 +1608,12 @@
|
|||
"default": "mixed",
|
||||
"description": "%config.untrackedChanges%",
|
||||
"scope": "resource"
|
||||
},
|
||||
"git.restoreCommitTemplateComments": {
|
||||
"type": "boolean",
|
||||
"scope": "resource",
|
||||
"default": true,
|
||||
"description": "%config.restoreCommitTemplateComments%"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -139,6 +139,7 @@
|
|||
"config.untrackedChanges.mixed": "All changes, tracked and untracked, appear together and behave equally.",
|
||||
"config.untrackedChanges.separate": "Untracked changes appear separately in the Source Control view. They are also excluded from several actions.",
|
||||
"config.untrackedChanges.hidden": "Untracked changes are hidden and excluded from several actions.",
|
||||
"config.restoreCommitTemplateComments": "Controls whether to restore commit template comments in the commit input box.",
|
||||
"colors.added": "Color for added resources.",
|
||||
"colors.modified": "Color for modified resources.",
|
||||
"colors.deleted": "Color for deleted resources.",
|
||||
|
|
|
@ -1823,7 +1823,6 @@ export class Repository {
|
|||
return message.replace(/^\s*#.*$\n?/gm, '').trim();
|
||||
}
|
||||
|
||||
|
||||
async getMergeMessage(): Promise<string | undefined> {
|
||||
const mergeMsgPath = path.join(this.repositoryRoot, '.git', 'MERGE_MSG');
|
||||
|
||||
|
|
|
@ -844,7 +844,15 @@ export class Repository implements Disposable {
|
|||
return mergeMessage;
|
||||
}
|
||||
|
||||
return await this.repository.getCommitTemplate();
|
||||
let template = await this.repository.getCommitTemplate();
|
||||
|
||||
const config = workspace.getConfiguration('git', Uri.file(this.root));
|
||||
|
||||
if (!config.get<boolean>('restoreCommitTemplateComments')) {
|
||||
template = this.cleanUpCommitEditMessage(template);
|
||||
}
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
getConfigs(): Promise<{ key: string; value: string; }[]> {
|
||||
|
@ -1278,7 +1286,7 @@ export class Repository implements Disposable {
|
|||
return await this.run(Operation.GetCommitTemplate, async () => this.repository.getCommitTemplate());
|
||||
}
|
||||
|
||||
async cleanUpCommitEditMessage(editMessage: string): Promise<string> {
|
||||
cleanUpCommitEditMessage(editMessage: string): string {
|
||||
return this.repository.cleanupCommitEditMessage(editMessage);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue