Skip to content

Commit

Permalink
Merge pull request #90398 from microsoft/eamodio/1.42-recovery
Browse files Browse the repository at this point in the history
Fixes #90229
  • Loading branch information
joaomoreno committed Feb 11, 2020
2 parents afe8e18 + 7e8d5b0 commit c47d83b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extensions/git/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit c47d83b

Please sign in to comment.