mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-14 10:03:15 -05:00
Adds .gitignore checks to reduce blame calls
Caches failed blames to reduce blame calls Only clear failed blames from cache on change/save Add better error messages and handling
This commit is contained in:
@@ -28,6 +28,9 @@ export default class GitBlameCodeLensProvider implements CodeLensProvider {
|
||||
const sha = data.sha;
|
||||
|
||||
return this.git.getBlameForFile(fileName).then(blame => {
|
||||
const lenses: CodeLens[] = [];
|
||||
if (!blame) return lenses;
|
||||
|
||||
const commits = Array.from(blame.commits.values());
|
||||
let index = commits.findIndex(c => c.sha === sha) + 1;
|
||||
|
||||
@@ -36,8 +39,6 @@ export default class GitBlameCodeLensProvider implements CodeLensProvider {
|
||||
previousCommit = commits[index];
|
||||
}
|
||||
|
||||
const lenses: CodeLens[] = [];
|
||||
|
||||
// Add codelens to each "group" of blame lines
|
||||
const lines = blame.lines.filter(l => l.sha === sha && l.originalLine >= data.range.start.line && l.originalLine <= data.range.end.line);
|
||||
let lastLine = lines[0].originalLine;
|
||||
|
||||
Reference in New Issue
Block a user