fix: clear reflog debounce timer on GitBaselineWatcher dispose (#71 item 6)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
BenStullsBets
2026-07-02 20:15:53 -07:00
parent 837d008572
commit 057bb93362
+6 -1
View File
@@ -119,7 +119,12 @@ export class GitBaselineAdapter implements vscode.Disposable {
if (pending) clearTimeout(pending); if (pending) clearTimeout(pending);
pending = setTimeout(() => void repo.status().catch(() => {}), 150); pending = setTimeout(() => void repo.status().catch(() => {}), 150);
}); });
this.disposables.push({ dispose: () => watcher.close() }); this.disposables.push({
dispose: () => {
watcher.close();
if (pending) clearTimeout(pending);
},
});
} catch { } catch {
// best-effort only — the passive repo.state.onDidChange listener still applies. // best-effort only — the passive repo.state.onDidChange listener still applies.
} }