mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 18:48:45 -05:00
Adds support for single files
This commit is contained in:
@@ -33,14 +33,7 @@ export async function activate(context: ExtensionContext) {
|
||||
const gitlens = extensions.getExtension(ExtensionId);
|
||||
const gitlensVersion = gitlens.packageJSON.version;
|
||||
|
||||
// Workspace not using a folder. No access to git repo.
|
||||
if (!workspace.rootPath) {
|
||||
Logger.warn(`GitLens(v${gitlensVersion}) inactive: no rootPath`);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const rootPath = workspace.rootPath.replace(/\\/g, '/');
|
||||
const rootPath = workspace.rootPath && workspace.rootPath.replace(/\\/g, '/');
|
||||
Logger.log(`GitLens(v${gitlensVersion}) active: ${rootPath}`);
|
||||
|
||||
const config = workspace.getConfiguration('').get<IConfig>('gitlens');
|
||||
@@ -48,9 +41,8 @@ export async function activate(context: ExtensionContext) {
|
||||
|
||||
configureCssCharacters(config.blame);
|
||||
|
||||
let repoPath: string;
|
||||
try {
|
||||
repoPath = await Git.getRepoPath(rootPath, gitPath);
|
||||
await Git.getGitPath(gitPath);
|
||||
}
|
||||
catch (ex) {
|
||||
Logger.error(ex, 'Extension.activate');
|
||||
@@ -61,6 +53,8 @@ export async function activate(context: ExtensionContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
const repoPath = await Git.getRepoPath(rootPath);
|
||||
|
||||
const gitVersion = Git.gitInfo().version;
|
||||
Logger.log(`Git version: ${gitVersion}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user