MCPcopy
hub / github.com/go-task/task / buildURL

Method buildURL

taskfile/node_git.go:105–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103}
104
105func (node *GitNode) buildURL() string {
106 // Get the base URL
107 baseURL := node.url.String()
108
109 // Always use git:: prefix for git URLs (following Terraform's pattern)
110 // This forces go-getter to use git protocol
111 if node.ref != "" {
112 return fmt.Sprintf("git::%s?ref=%s&depth=1", baseURL, node.ref)
113 }
114 // When no ref is specified, omit it entirely to let git clone the default branch
115 return fmt.Sprintf("git::%s?depth=1", baseURL)
116}
117
118// getOrCloneRepo returns the path to a cached git repository.
119// If the repository is not cached, it clones it first.

Callers 2

TestGitNode_buildURLFunction · 0.95
getOrCloneRepoMethod · 0.95

Calls 1

StringMethod · 0.45

Tested by 1

TestGitNode_buildURLFunction · 0.76