MCPcopy Create free account
hub / github.com/belak/gitdir / SetOrgHash

Method SetOrgHash

config.go:224–238  ·  view source on GitHub ↗

SetOrgHash will set the hash of the given org repo to use when loading.

(orgName, hash string)

Source from the content-addressed store, hash-verified

222
223// SetOrgHash will set the hash of the given org repo to use when loading.
224func (c *Config) SetOrgHash(orgName, hash string) error {
225 repo, err := git.EnsureRepo(c.fs, "admin/org-"+orgName)
226 if err != nil {
227 return err
228 }
229
230 err = repo.Checkout(hash)
231 if err != nil {
232 return err
233 }
234
235 c.orgRepos[orgName] = hash
236
237 return nil
238}

Callers 1

runUpdateHookMethod · 0.95

Calls 2

EnsureRepoFunction · 0.92
CheckoutMethod · 0.80

Tested by

no test coverage detected