Merge from vscode 9bc92b48d945144abb405b9e8df05e18accb9148

This commit is contained in:
ADS Merger
2020-02-19 03:11:35 +00:00
parent 98584d32a7
commit 1e308639e5
253 changed files with 6414 additions and 2296 deletions

View File

@@ -44,6 +44,7 @@ export interface Commit {
readonly authorDate?: Date;
readonly authorName?: string;
readonly authorEmail?: string;
readonly commitDate?: Date;
}
export interface Submodule {

View File

@@ -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%ct%n%P%n%B';
export class Git {
@@ -525,6 +525,7 @@ export interface Commit {
authorDate?: Date;
authorName?: string;
authorEmail?: string;
commitDate?: Date;
}
export class GitStatusParser {
@@ -655,15 +656,16 @@ export function parseGitmodules(raw: string): Submodule[] {
return result;
}
const commitRegex = /([0-9a-f]{40})\n(.*)\n(.*)\n(.*)\n(.*)(?:\n([^]*?))?(?:\x00)/gm;
const commitRegex = /([0-9a-f]{40})\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)(?:\n([^]*?))?(?:\x00)/gm;
export function parseGitCommits(data: string): Commit[] {
let commits: Commit[] = [];
let ref;
let name;
let email;
let date;
let authorName;
let authorEmail;
let authorDate;
let commitDate;
let parents;
let message;
let match;
@@ -674,7 +676,7 @@ export function parseGitCommits(data: string): Commit[] {
break;
}
[, ref, name, email, date, parents, message] = match;
[, ref, authorName, authorEmail, authorDate, commitDate, parents, message] = match;
if (message[message.length - 1] === '\n') {
message = message.substr(0, message.length - 1);
@@ -685,9 +687,10 @@ export function parseGitCommits(data: string): Commit[] {
hash: ` ${ref}`.substr(1),
message: ` ${message}`.substr(1),
parents: parents ? parents.split(' ') : [],
authorDate: new Date(Number(date) * 1000),
authorName: ` ${name}`.substr(1),
authorEmail: ` ${email}`.substr(1)
authorDate: new Date(Number(authorDate) * 1000),
authorName: ` ${authorName}`.substr(1),
authorEmail: ` ${authorEmail}`.substr(1),
commitDate: new Date(Number(commitDate) * 1000),
});
} while (true);

View File

@@ -178,7 +178,8 @@ export async function activate(context: ExtensionContext): Promise<GitExtension>
// console.warn(err.message);
// outputChannel.appendLine(err.message);
// warnAboutMissingGit();
commands.executeCommand('setContext', 'git.missing', true);
// warnAboutMissingGit(); {{SQL CARBON EDIT}} turn-off Git missing prompt
return new GitExtensionImpl();
}

View File

@@ -192,6 +192,7 @@ suite('git', () => {
John Doe
john.doe@mail.com
1580811030
1580811031
8e5a374372b8393906c7e380dbb09349c5385554
This is a commit message.\x00`;
@@ -202,6 +203,7 @@ This is a commit message.\x00`;
authorDate: new Date(1580811030000),
authorName: 'John Doe',
authorEmail: 'john.doe@mail.com',
commitDate: new Date(1580811031000),
}]);
});
@@ -210,6 +212,7 @@ This is a commit message.\x00`;
John Doe
john.doe@mail.com
1580811030
1580811031
8e5a374372b8393906c7e380dbb09349c5385554 df27d8c75b129ab9b178b386077da2822101b217
This is a commit message.\x00`;
@@ -220,6 +223,7 @@ This is a commit message.\x00`;
authorDate: new Date(1580811030000),
authorName: 'John Doe',
authorEmail: 'john.doe@mail.com',
commitDate: new Date(1580811031000),
}]);
});
@@ -228,6 +232,7 @@ This is a commit message.\x00`;
John Doe
john.doe@mail.com
1580811030
1580811031
This is a commit message.\x00`;
@@ -238,6 +243,7 @@ This is a commit message.\x00`;
authorDate: new Date(1580811030000),
authorName: 'John Doe',
authorEmail: 'john.doe@mail.com',
commitDate: new Date(1580811031000),
}]);
});
});