Support .git in repo cache and improve language - #275075
Merged
Merged
Conversation
Done while testing #274930
Alex Ross (alexr00)
requested review from
Copilot and
Ladislau Szomoru (lszomoru)
November 4, 2025 10:47
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the Git repository caching mechanism by normalizing repository URLs to handle URL variations (with/without .git suffix and trailing slashes), and simplifies user-facing clone messages by removing redundant wording.
- Adds URL normalization to the
RepositoryCacheclass to ensure consistent cache key generation - Updates all cache operations (
set,get,delete) to use normalized URLs - Simplifies clone completion messages by removing the word "cloned"
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| extensions/git/src/repositoryCache.ts | Adds normalizeRepoUrl method to strip .git suffix and trailing slashes; updates cache operations to normalize URLs before use |
| extensions/git/src/cloneManager.ts | Simplifies user-facing messages from "cloned repository" to "repository" |
Comments suppressed due to low confidence (1)
extensions/git/src/repositoryCache.ts:158
- The
loadmethod stores repository URLs without normalization, but cache operations now use normalized URLs. This creates a mismatch: URLs saved before this change (or loaded from persistent storage) won't be found byget/set/deleteoperations. ApplynormalizeRepoUrlto therepovariable at line 156 before storing it in the LRU at line 173.
private load(): void {
try {
const raw = this._globalState.get<[string, [string, RepositoryCacheInfo][]][]>(RepositoryCache.STORAGE_KEY);
if (!Array.isArray(raw)) {
return;
}
for (const [repo, storedFolders] of raw) {
if (typeof repo !== 'string' || !Array.isArray(storedFolders)) {
continue;
Alex Ross (alexr00)
marked this pull request as ready for review
November 4, 2025 11:03
Ladislau Szomoru (lszomoru)
approved these changes
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Done while testing #274930