未验证 提交 c47d83b2 编写于 作者: J João Moreno 提交者: GitHub

Merge pull request #90398 from microsoft/eamodio/1.42-recovery

Fixes #90229
......@@ -333,7 +333,7 @@ function sanitizePath(path: string): string {
return path.replace(/^([a-z]):\\/i, (_, letter) => `${letter.toUpperCase()}:\\`);
}
const COMMIT_FORMAT = '%H\n%aN\n%aE\n%at\n%P\n%B';
const COMMIT_FORMAT = '%H%n%aN%n%aE%n%at%n%P%n%B';
export class Git {
......@@ -809,8 +809,8 @@ export class Repository {
}
async log(options?: LogOptions): Promise<Commit[]> {
const maxEntries = options && typeof options.maxEntries === 'number' && options.maxEntries > 0 ? options.maxEntries : 32;
const args = ['log', '-' + maxEntries, `--format:${COMMIT_FORMAT}`, '-z'];
const maxEntries = options?.maxEntries ?? 32;
const args = ['log', `-n${maxEntries}`, `--format=${COMMIT_FORMAT}`, '-z', '--'];
const result = await this.run(args);
if (result.exitCode) {
......@@ -823,7 +823,7 @@ export class Repository {
async logFile(uri: Uri, options?: LogFileOptions): Promise<Commit[]> {
const maxEntries = options?.maxEntries ?? 32;
const args = ['log', `-${maxEntries}`, `--format=${COMMIT_FORMAT}`, '-z', '--', uri.fsPath];
const args = ['log', `-n${maxEntries}`, `--format=${COMMIT_FORMAT}`, '-z', '--', uri.fsPath];
const result = await this.run(args);
if (result.exitCode) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册