mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
When resolving a merge conflict allow accepting the default commit message
Fixes #6403
This commit is contained in:
@@ -1514,6 +1514,24 @@ export class Repository {
|
||||
}
|
||||
}
|
||||
|
||||
cleanupCommitEditMessage(message: string): string {
|
||||
//TODO: Support core.commentChar
|
||||
return message.replace(/^\s*#.*$\n?/gm, '').trim();
|
||||
}
|
||||
|
||||
|
||||
async getMergeMessage(): Promise<string | undefined> {
|
||||
const mergeMsgPath = path.join(this.repositoryRoot, '.git', 'MERGE_MSG');
|
||||
try {
|
||||
const raw = await readfile(mergeMsgPath, 'utf8');
|
||||
return raw.trim();
|
||||
}
|
||||
catch {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async getCommitTemplate(): Promise<string> {
|
||||
try {
|
||||
const result = await this.run(['config', '--get', 'commit.template']);
|
||||
@@ -1532,7 +1550,7 @@ export class Repository {
|
||||
}
|
||||
|
||||
const raw = await readfile(templatePath, 'utf8');
|
||||
return raw.replace(/^\s*#.*$\n?/gm, '').trim();
|
||||
return raw.trim();
|
||||
|
||||
} catch (err) {
|
||||
return '';
|
||||
|
||||
Reference in New Issue
Block a user