Skip to content

Commit aa70f38

Browse files
committed
Revert "Fix #88294 Add commitData in commit interface"
This reverts commit 51b8bd5.
1 parent 45956fe commit aa70f38

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

extensions/git/src/api/git.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export interface Commit {
4444
readonly authorDate?: Date;
4545
readonly authorName?: string;
4646
readonly authorEmail?: string;
47-
readonly commitDate?: Date;
4847
}
4948

5049
export interface Submodule {

extensions/git/src/git.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ function sanitizePath(path: string): string {
333333
return path.replace(/^([a-z]):\\/i, (_, letter) => `${letter.toUpperCase()}:\\`);
334334
}
335335

336-
const COMMIT_FORMAT = '%H%n%aN%n%aE%n%at%n%ct%n%P%n%B';
336+
const COMMIT_FORMAT = '%H%n%aN%n%aE%n%at%n%P%n%B';
337337

338338
export class Git {
339339

@@ -525,7 +525,6 @@ export interface Commit {
525525
authorDate?: Date;
526526
authorName?: string;
527527
authorEmail?: string;
528-
commitDate?: Date;
529528
}
530529

531530
export class GitStatusParser {
@@ -656,16 +655,15 @@ export function parseGitmodules(raw: string): Submodule[] {
656655
return result;
657656
}
658657

659-
const commitRegex = /([0-9a-f]{40})\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)(?:\n([^]*?))?(?:\x00)/gm;
658+
const commitRegex = /([0-9a-f]{40})\n(.*)\n(.*)\n(.*)\n(.*)(?:\n([^]*?))?(?:\x00)/gm;
660659

661660
export function parseGitCommits(data: string): Commit[] {
662661
let commits: Commit[] = [];
663662

664663
let ref;
665-
let authorName;
666-
let authorEmail;
667-
let authorDate;
668-
let commitDate;
664+
let name;
665+
let email;
666+
let date;
669667
let parents;
670668
let message;
671669
let match;
@@ -676,7 +674,7 @@ export function parseGitCommits(data: string): Commit[] {
676674
break;
677675
}
678676

679-
[, ref, authorName, authorEmail, authorDate, commitDate, parents, message] = match;
677+
[, ref, name, email, date, parents, message] = match;
680678

681679
if (message[message.length - 1] === '\n') {
682680
message = message.substr(0, message.length - 1);
@@ -687,10 +685,9 @@ export function parseGitCommits(data: string): Commit[] {
687685
hash: ` ${ref}`.substr(1),
688686
message: ` ${message}`.substr(1),
689687
parents: parents ? parents.split(' ') : [],
690-
authorDate: new Date(Number(authorDate) * 1000),
691-
authorName: ` ${authorName}`.substr(1),
692-
authorEmail: ` ${authorEmail}`.substr(1),
693-
commitDate: new Date(Number(commitDate) * 1000),
688+
authorDate: new Date(Number(date) * 1000),
689+
authorName: ` ${name}`.substr(1),
690+
authorEmail: ` ${email}`.substr(1)
694691
});
695692
} while (true);
696693

0 commit comments

Comments
 (0)