بنقرة واحدة
github-repo-resolution
Normalize GitHub remotes from git -C cwd and prefer fork parents
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Normalize GitHub remotes from git -C cwd and prefer fork parents
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
{what this skill teaches agents}
Build real git source, bare remote, and local clone fixtures for CopilotBooster integration tests.
{what this skill teaches agents}
Reusable WinForms pattern for textboxes that accept either a bare GitHub PR/Issue number or a full github.com URL.
Core conventions and patterns for this codebase
Isolate tests for services that write under %LOCALAPPDATA% without touching the real user profile.
| name | github-repo-resolution |
| description | Normalize GitHub remotes from git -C cwd and prefer fork parents |
| domain | csharp-services |
| confidence | medium |
| source | issue-19 |
Use when a service needs the canonical GitHub repo for a Copilot session cwd.
var result = GitService.ResolveGitHubRepo(cwd);
var repo = GitService.TryResolveGitHubRepo(cwd);
git -C <cwd>, never literal .git checks.upstream first, then origin.GitHubRepoResolution.NotAGitRepo when git -C cwd rev-parse --is-inside-work-tree fails.GitHubRepoResolution.NoRemote when neither remote exists.GitHubRepoResolution.NonGitHubRemote when the selected remote exists but host is not github.com.| Form | Result |
|---|---|
https://github.com/owner/repo(.git)? | owner/repo |
git@github.com:owner/repo(.git)? | owner/repo |
ssh://git@github.com/owner/repo(.git)? | owner/repo |
Host comparison is case-insensitive. Owner and repo casing are preserved.
After parsing a GitHub remote, run:
gh repo view owner/repo --json parent --jq .parent.nameWithOwner
Use a 5 second timeout. Fall back to the parsed remote if gh is unavailable, fails, times out, or returns no parent. Tests can set GH_PATH to a fake executable.