MCPcopy Create free account
hub / github.com/JordanCoin/codemap / resolveBlastRadiusRoot

Function resolveBlastRadiusRoot

blast_radius.go:403–425  ·  view source on GitHub ↗
(root string)

Source from the content-addressed store, hash-verified

401}
402
403func resolveBlastRadiusRoot(root string) (string, func(), error) {
404 cleanup := func() {}
405 _, localErr := os.Stat(root)
406 if isGitHubURL(root) {
407 if os.IsNotExist(localErr) {
408 repoName := extractRepoName(root)
409 tempDir, err := cloneRepo(root, repoName)
410 if err != nil {
411 return "", cleanup, err
412 }
413 cleanup = func() { _ = os.RemoveAll(tempDir) }
414 root = tempDir
415 } else if localErr != nil {
416 return "", cleanup, localErr
417 }
418 }
419
420 absRoot, err := filepath.Abs(root)
421 if err != nil {
422 return "", cleanup, err
423 }
424 return absRoot, cleanup, nil
425}
426
427func buildBlastRadiusBundle(absRoot, ref string, limits blastRadiusLimits) (blastRadiusBundle, error) {
428 diffInfo, err := scanner.GitDiffInfo(absRoot, ref)

Callers 1

Calls 3

isGitHubURLFunction · 0.85
extractRepoNameFunction · 0.85
cloneRepoFunction · 0.85

Tested by

no test coverage detected