Repository navigation
Keep a cloned repository's folder when an owner scan lists it [patch] - #473
Open
matt-edmondson wants to merge 2 commits into
Open
matt-edmondson wants to merge 2 commits into
matt-edmondson wants to merge 2 commits into
Conversation
Scan GitHub Owners replaced every listed repository with one at <dev>/<owner>/<repo>, even when Scan Dev Dir had already found it cloned elsewhere, and the old ClonedRepos entry was never visited again. The repository then fetched a folder that does not exist every minute and offered Pull, Commit and Push that all failed. The owner scan now keeps a known repository's path when it is a clone, and UpdateClonedStatus prunes ClonedRepos entries whose repository no longer points at their path. Fixes #438 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KLpJqJzDAe9WoXTVLt65CJ
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KLpJqJzDAe9WoXTVLt65CJ
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Fixes #438
Problem
SyncGitHubRepoInfoForOwneralways replacedOptions.Repos[repoName]with a repository at<dev>/<owner>/<repo>, even when Scan Dev Dir had already found it cloned somewhere else, such as<dev>/<repo>.UpdateClonedStatuswalks onlyOptions.Repos, so it never visited the oldClonedReposentry. After Scan Dev Dir followed by Scan GitHub Owners, the repository:Changes
ChooseSyncedLocalPath: if the repository is already known and itsLocalPathis a git repository, the owner scan keeps that path. Otherwise it uses the conventional one.PruneStaleClonedRepos, called fromUpdateClonedStatus: removesClonedReposentries whose repository is unknown or no longer points at that path.Both are plain
internal staticmethods, following the repo's pattern of keeping logic out of the ImGui layer so it can be tested.Tests
New
OwnerSyncTests:AnOwnerScanKeepsTheFolderARepositoryIsAlreadyClonedIn: a realgit initunder a temp dev directoryAnOwnerScanUsesTheConventionalFolderForAnUnknownRepositoryAnOwnerScanUsesTheConventionalFolderWhenTheKnownOneIsNotACloneACloneRecordedAtAPathItsRepositoryNoLongerUsesIsPrunedACloneOfAnUnknownRepositoryIsPrunedACloneRecordedAtItsRepositorysPathIsKeptI stubbed both methods back to the old behaviour (always the conventional path, never prune). With the stubs, the three tests that cover the bug fail. With the fix they pass.
Full suite: 138 of 139 pass. The one failure,
GitCliTests.CloningAnLfsRepositoryRestoresTheFileContentRatherThanThePointer, fails the same way with this change reverted. It's caused by the local sandbox's git-lfs setup, not by this PR.dotnet format --verify-no-changesreports two findings inProjectDirector.cs(import ordering, and IDE0001 inChooseCredentials). Both are already onmain, and nothing in this diff adds to them.🤖 Generated with Claude Code
https://claude.ai/code/session_01KLpJqJzDAe9WoXTVLt65CJ
Generated by Claude Code