mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
1872cb3854
* Initial plan * Add garbage collection for old content-addressed askpass directories - Implement updateDirectoryMtime to update folder mtime when used - Add garbageCollectOldDirectories to remove folders older than 7 days - Update ensureAskpassScripts to call GC on every activation - Add comprehensive test coverage for GC functionality Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com> * Remove GC from fast path to keep it fast Only run garbage collection when creating new directories, not when reusing existing ones. Old folders only accumulate when creating new content-addressed directories. Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com> * Hoist askpassBaseDir variable to avoid duplication Declare askpassBaseDir once at the top of the function and reuse it when constructing askpassDir and when calling garbageCollectOldDirectories. Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com> * Fix test failures and address bot review comments - Export ensureAskpassScripts for testing to avoid dependency on isWindowsUserOrSystemSetup check - Remove redundant success log after directory removal - Update tests to call ensureAskpassScripts directly instead of getAskpassPaths - Remove Windows-only restrictions from tests to make them cross-platform - Remove setTimeout workarounds - tests now properly await async operations Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com> * formatting --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com> Co-authored-by: João Moreno <joaomoreno@users.noreply.github.com>
Git integration for Visual Studio Code
Notice: This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
Features
See Git support in VS Code to learn about the features of this extension.
API
The Git extension exposes an API, reachable by any other extension.
-
Copy
src/api/git.d.tsto your extension's sources; -
Include
git.d.tsin your extension's compilation. -
Get a hold of the API with the following snippet:
const gitExtension = vscode.extensions.getExtension<GitExtension>('vscode.git').exports; const git = gitExtension.getAPI(1);Note: To ensure that the
vscode.gitextension is activated before your extension, addextensionDependencies(docs) into thepackage.jsonof your extension:"extensionDependencies": [ "vscode.git" ]