MCPcopy Create free account
hub / github.com/github/gh-aw / getCurrentRepoName

Function getCurrentRepoName

pkg/cli/devcontainer.go:329–342  ·  view source on GitHub ↗

getCurrentRepoName gets the current repository name from git remote in owner/repo format

()

Source from the content-addressed store, hash-verified

327
328// getCurrentRepoName gets the current repository name from git remote in owner/repo format
329func getCurrentRepoName() string {
330 // Try to get the repository name from git remote using centralized helper
331 slug := getRepositorySlugFromRemote()
332 if slug != "" {
333 return slug
334 }
335
336 // Fallback to directory name
337 gitRoot, err := gitutil.FindGitRoot()
338 if err != nil {
339 return ""
340 }
341 return filepath.Base(gitRoot)
342}
343
344// getRepoOwner extracts the owner from the git remote URL
345func getRepoOwner() string {

Callers 2

ensureDevcontainerConfigFunction · 0.85
TestGetCurrentRepoNameFunction · 0.85

Calls 2

FindGitRootFunction · 0.92

Tested by 1

TestGetCurrentRepoNameFunction · 0.68