Skip to content

Commit

Permalink
Revert "Fix #88294 Add commitData in commit interface"
Browse files Browse the repository at this point in the history
This reverts commit 51b8bd5.
  • Loading branch information
alexdima committed Feb 18, 2020
1 parent 45956fe commit aa70f38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion extensions/git/src/api/git.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export interface Commit {
readonly authorDate?: Date;
readonly authorName?: string;
readonly authorEmail?: string;
readonly commitDate?: Date;
}

export interface Submodule {
Expand Down
21 changes: 9 additions & 12 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%ct%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 @@ -525,7 +525,6 @@ export interface Commit {
authorDate?: Date;
authorName?: string;
authorEmail?: string;
commitDate?: Date;
}

export class GitStatusParser {
Expand Down Expand Up @@ -656,16 +655,15 @@ export function parseGitmodules(raw: string): Submodule[] {
return result;
}

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

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

let ref;
let authorName;
let authorEmail;
let authorDate;
let commitDate;
let name;
let email;
let date;
let parents;
let message;
let match;
Expand All @@ -676,7 +674,7 @@ export function parseGitCommits(data: string): Commit[] {
break;
}

[, ref, authorName, authorEmail, authorDate, commitDate, parents, message] = match;
[, ref, name, email, date, parents, message] = match;

if (message[message.length - 1] === '\n') {
message = message.substr(0, message.length - 1);
Expand All @@ -687,10 +685,9 @@ export function parseGitCommits(data: string): Commit[] {
hash: ` ${ref}`.substr(1),
message: ` ${message}`.substr(1),
parents: parents ? parents.split(' ') : [],
authorDate: new Date(Number(authorDate) * 1000),
authorName: ` ${authorName}`.substr(1),
authorEmail: ` ${authorEmail}`.substr(1),
commitDate: new Date(Number(commitDate) * 1000),
authorDate: new Date(Number(date) * 1000),
authorName: ` ${name}`.substr(1),
authorEmail: ` ${email}`.substr(1)
});
} while (true);

Expand Down

1 comment on commit aa70f38

@alexdima
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.