未验证 提交 aa70f38a 编写于 作者: A Alex Dima

Revert "Fix #88294 Add commitData in commit interface"

This reverts commit 51b8bd50.
上级 45956fea
...@@ -44,7 +44,6 @@ export interface Commit { ...@@ -44,7 +44,6 @@ export interface Commit {
readonly authorDate?: Date; readonly authorDate?: Date;
readonly authorName?: string; readonly authorName?: string;
readonly authorEmail?: string; readonly authorEmail?: string;
readonly commitDate?: Date;
} }
export interface Submodule { export interface Submodule {
......
...@@ -333,7 +333,7 @@ function sanitizePath(path: string): string { ...@@ -333,7 +333,7 @@ function sanitizePath(path: string): string {
return path.replace(/^([a-z]):\\/i, (_, letter) => `${letter.toUpperCase()}:\\`); 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 { export class Git {
...@@ -525,7 +525,6 @@ export interface Commit { ...@@ -525,7 +525,6 @@ export interface Commit {
authorDate?: Date; authorDate?: Date;
authorName?: string; authorName?: string;
authorEmail?: string; authorEmail?: string;
commitDate?: Date;
} }
export class GitStatusParser { export class GitStatusParser {
...@@ -656,16 +655,15 @@ export function parseGitmodules(raw: string): Submodule[] { ...@@ -656,16 +655,15 @@ export function parseGitmodules(raw: string): Submodule[] {
return result; 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[] { export function parseGitCommits(data: string): Commit[] {
let commits: Commit[] = []; let commits: Commit[] = [];
let ref; let ref;
let authorName; let name;
let authorEmail; let email;
let authorDate; let date;
let commitDate;
let parents; let parents;
let message; let message;
let match; let match;
...@@ -676,7 +674,7 @@ export function parseGitCommits(data: string): Commit[] { ...@@ -676,7 +674,7 @@ export function parseGitCommits(data: string): Commit[] {
break; break;
} }
[, ref, authorName, authorEmail, authorDate, commitDate, parents, message] = match; [, ref, name, email, date, parents, message] = match;
if (message[message.length - 1] === '\n') { if (message[message.length - 1] === '\n') {
message = message.substr(0, message.length - 1); message = message.substr(0, message.length - 1);
...@@ -687,10 +685,9 @@ export function parseGitCommits(data: string): Commit[] { ...@@ -687,10 +685,9 @@ export function parseGitCommits(data: string): Commit[] {
hash: ` ${ref}`.substr(1), hash: ` ${ref}`.substr(1),
message: ` ${message}`.substr(1), message: ` ${message}`.substr(1),
parents: parents ? parents.split(' ') : [], parents: parents ? parents.split(' ') : [],
authorDate: new Date(Number(authorDate) * 1000), authorDate: new Date(Number(date) * 1000),
authorName: ` ${authorName}`.substr(1), authorName: ` ${name}`.substr(1),
authorEmail: ` ${authorEmail}`.substr(1), authorEmail: ` ${email}`.substr(1)
commitDate: new Date(Number(commitDate) * 1000),
}); });
} while (true); } while (true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册