MCPcopy Create free account
hub / github.com/HashLoad/boss / CloneCacheEmbedded

Function CloneCacheEmbedded

core/gitWrapper/git_embedded.go:20–38  ·  view source on GitHub ↗
(dep models.Dependency)

Source from the content-addressed store, hash-verified

18)
19
20func CloneCacheEmbedded(dep models.Dependency) *git.Repository {
21 msg.Info("Downloading dependency %s", dep.Repository)
22 storageCache := makeStorageCache(dep)
23 wtFs := makeWtFileSystem(dep)
24 url := dep.GetURL()
25 auth := env.GlobalConfiguration.GetAuth(dep.GetURLPrefix())
26
27 repository, e := git.Clone(storageCache, wtFs, &git.CloneOptions{
28 URL: url,
29 Tags: git.AllTags,
30 Auth: auth,
31 })
32 if e != nil {
33 _ = os.RemoveAll(filepath.Join(env.GetCacheDir(), dep.GetHashName()))
34 msg.Die("Error to get repository of %s: %s", dep.Repository, e)
35 }
36 initSubmodules(dep, repository)
37 return repository
38}
39
40func UpdateCacheEmbedded(dep models.Dependency) *git.Repository {
41 storageCache := makeStorageCache(dep)

Callers 2

CloneCacheFunction · 0.85
refreshCopyFunction · 0.85

Calls 10

InfoFunction · 0.92
GetCacheDirFunction · 0.92
DieFunction · 0.92
makeStorageCacheFunction · 0.85
makeWtFileSystemFunction · 0.85
initSubmodulesFunction · 0.85
GetURLMethod · 0.80
GetAuthMethod · 0.80
GetURLPrefixMethod · 0.80
GetHashNameMethod · 0.80

Tested by

no test coverage detected