Browse Source

Renames GitService.getGitPath for clarity

main
Eric Amodio 7 years ago
parent
commit
ed43454880
3 changed files with 9 additions and 6 deletions
  1. +1
    -2
      src/extension.ts
  2. +1
    -1
      src/git/git.ts
  3. +7
    -3
      src/gitService.ts

+ 1
- 2
src/extension.ts View File

@ -28,10 +28,9 @@ export async function activate(context: ExtensionContext) {
Logger.log(`GitLens(v${gitlensVersion}) active`);
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!;
const gitPath = cfg.advanced.git;
try {
await GitService.getGitPath(gitPath);
await GitService.initialize(cfg.advanced.git);
}
catch (ex) {
Logger.error(ex, 'Extension.activate');

+ 1
- 1
src/git/git.ts View File

@ -124,7 +124,7 @@ export class Git {
: 'utf8';
}
static async getGitPath(gitPath?: string): Promise<IGit> {
static async getGitInfo(gitPath?: string): Promise<IGit> {
git = await findGitPath(gitPath);
Logger.log(`Git found: ${git.version} @ ${git.path === 'git' ? 'PATH' : git.path}`);
return git;

+ 7
- 3
src/gitService.ts View File

@ -10,7 +10,7 @@ import { Logger } from './logger';
import * as fs from 'fs';
import * as path from 'path';
export { GitUri, IGitCommitInfo };
export { GitUri, IGit, IGitCommitInfo };
export * from './git/models/models';
export * from './git/formatters/commit';
export * from './git/formatters/status';
@ -1131,8 +1131,12 @@ export class GitService extends Disposable {
return Git.getEncoding(workspace.getConfiguration('files', uri).get<string>('encoding'));
}
static getGitPath(gitPath?: string): Promise<IGit> {
return Git.getGitPath(gitPath);
static initialize(gitPath?: string): Promise<IGit> {
return Git.getGitInfo(gitPath);
}
static getGitPath(): string {
return Git.gitInfo().path;
}
static getGitVersion(): string {

Loading…
Cancel
Save