Repository navigation
Strip only a trailing .git from the remote URL, so ktsu-dev/.github no longer parses as ktsu-dev/hub [patch] - #171
Merged
Conversation
…o longer parses as ktsu-dev/hub [patch] ParseRepositoryFromRemoteUrl removed every ".git" in the URL, so local runs in ktsu-dev/.github or any *.github.io repository wrote a wrong PROJECT_URL.url and LICENSE.md. Only a trailing suffix is stripped now, case-insensitively, matching WingetService.DetectGitHubRepoAsync. Fixes #164 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHrrj7bWzA48Gf3akqi476
|
2 tasks
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 #164
What was wrong
When
GITHUB_REPOSITORYis unset, as on every local run,BuildConfigurationProvider.ParseRepositoryFromRemoteUrlgetsowner/repofrom the Git remote using.Replace(".git", string.Empty). That removes every.gitin the string, not just the suffix:https://github.com/ktsu-dev/.github.gitbecamektsu-dev/hubgit@github.com:ktsu-dev/ktsu-dev.github.io.gitbecamektsu-dev/ktsu-devhub.ioThe wrong value then goes into
PROJECT_URL.urland into{PROJECT_URL}inLICENSE.md.Change
After trimming trailing slashes, only a trailing
.gitis stripped, compared case-insensitively. This is the same ruleWingetService.DetectGitHubRepoAsyncalready uses.I didn't merge the two parsers into one, although the issue lists that as optional. The triage note points out that sharing the parser would reach into the area of #162, so this PR stays a one-line fix.
Tests
CreateFromEnvironmentAsync_RemoteContainingDotGit_StripsOnlyTheTrailingSuffix, which goes through the same mocked-remote path as the existing remote tests. Its rows:.githubover HTTPS, over SSH, and with no suffix*.github.iorepo over SSH.GITsuffixrepo.git/, a suffix followed by a slashBefore the fix, 5 of the 6 rows fail (
ktsu-dev/hub,ktsu-dev/ktsu-devhub.io,owner/repo.GIT). With the fix, the fullKtsuBuild.Testssuite passes (760/760).🤖 Generated with Claude Code
https://claude.ai/code/session_01PHrrj7bWzA48Gf3akqi476
Generated by Claude Code