Refactors git models & parsers

Adds full git status parsing
Adds git status info into status quick pick
Switches to async/await in file blame/log
This commit is contained in:
Eric Amodio
2017-03-19 00:36:51 -04:00
parent 14eebbba15
commit ef74ae0950
19 changed files with 556 additions and 407 deletions

View File

@@ -23,10 +23,10 @@ export class CloseUnchangedFilesCommand extends ActiveEditorCommand {
const repoPath = await this.git.getRepoPathFromUri(uri, this.repoPath);
if (!repoPath) return window.showWarningMessage(`Unable to close unchanged files`);
const statuses = await this.git.getStatusesForRepo(repoPath);
if (!statuses) return window.showWarningMessage(`Unable to close unchanged files`);
const status = await this.git.getStatusForRepo(repoPath);
if (!status) return window.showWarningMessage(`Unable to close unchanged files`);
uris = statuses.map(_ => Uri.file(path.resolve(repoPath, _.fileName)));
uris = status.files.map(_ => Uri.file(path.resolve(repoPath, _.fileName)));
}
const editorTracker = new ActiveEditorTracker();

View File

@@ -21,10 +21,10 @@ export class OpenChangedFilesCommand extends ActiveEditorCommand {
const repoPath = await this.git.getRepoPathFromUri(uri, this.repoPath);
if (!repoPath) return window.showWarningMessage(`Unable to open changed files`);
const statuses = await this.git.getStatusesForRepo(repoPath);
if (!statuses) return window.showWarningMessage(`Unable to open changed files`);
const status = await this.git.getStatusForRepo(repoPath);
if (!status) return window.showWarningMessage(`Unable to open changed files`);
uris = statuses.filter(_ => _.status !== 'D').map(_ => Uri.file(path.resolve(repoPath, _.fileName)));
uris = status.files.filter(_ => _.status !== 'D').map(_ => Uri.file(path.resolve(repoPath, _.fileName)));
}
for (const uri of uris) {

View File

@@ -20,10 +20,10 @@ export class ShowQuickRepoStatusCommand extends ActiveEditorCommand {
const repoPath = await this.git.getRepoPathFromUri(uri, this.repoPath);
if (!repoPath) return window.showWarningMessage(`Unable to show repository status`);
const statuses = await this.git.getStatusesForRepo(repoPath);
if (!statuses) return window.showWarningMessage(`Unable to show repository status`);
const status = await this.git.getStatusForRepo(repoPath);
if (!status) return window.showWarningMessage(`Unable to show repository status`);
const pick = await RepoStatusQuickPick.show(statuses, goBackCommand);
const pick = await RepoStatusQuickPick.show(status, goBackCommand);
if (!pick) return undefined;
if (pick instanceof CommandQuickPickItem) {