MCPcopy Create free account
hub / github.com/entireio/git-sync / normalizeRepoURL

Function normalizeRepoURL

cmd/git-sync-bench/main.go:381–390  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

379}
380
381func normalizeRepoURL(raw string) (string, error) {
382 raw = strings.TrimSpace(raw)
383 if raw == "" {
384 return "", usageError("--source-url is required")
385 }
386 if u, err := url.Parse(raw); err == nil && u.Scheme != "" {
387 return raw, nil
388 }
389 return fileURL(raw)
390}
391
392func fileURL(path string) (string, error) {
393 abs, err := filepath.Abs(path)

Callers 2

TestNormalizeRepoURLFunction · 0.85
runFunction · 0.85

Calls 2

usageErrorFunction · 0.85
fileURLFunction · 0.85

Tested by 1

TestNormalizeRepoURLFunction · 0.68