MCPcopy Index your code
hub / github.com/jetify-com/devbox / newGitPlugin

Function newGitPlugin

internal/plugin/git.go:27–38  ·  view source on GitHub ↗

newGitPlugin creates a Git plugin from a flake reference. It uses git clone to fetch the repository.

(ref flake.Ref)

Source from the content-addressed store, hash-verified

25// newGitPlugin creates a Git plugin from a flake reference.
26// It uses git clone to fetch the repository.
27func newGitPlugin(ref flake.Ref) (*gitPlugin, error) {
28 if ref.Type != flake.TypeGit {
29 return nil, fmt.Errorf("expected git flake reference, got %s", ref.Type)
30 }
31
32 name := generateGitPluginName(ref)
33
34 return &gitPlugin{
35 ref: &ref,
36 name: name,
37 }, nil
38}
39
40func generateGitPluginName(ref flake.Ref) string {
41 // Extract repository name from URL and append directory if specified

Callers 3

parseIncludableFunction · 0.85
TestGitPluginFunction · 0.85
TestGitPluginURLFunction · 0.85

Calls 1

generateGitPluginNameFunction · 0.85

Tested by 2

TestGitPluginFunction · 0.68
TestGitPluginURLFunction · 0.68