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

Method SetUserHash

config.go:207–221  ·  view source on GitHub ↗

SetUserHash will set the hash of the given user repo to use when loading.

(username, hash string)

Source from the content-addressed store, hash-verified

205
206// SetUserHash will set the hash of the given user repo to use when loading.
207func (c *Config) SetUserHash(username, hash string) error {
208 repo, err := git.EnsureRepo(c.fs, "admin/user-"+username)
209 if err != nil {
210 return err
211 }
212
213 err = repo.Checkout(hash)
214 if err != nil {
215 return err
216 }
217
218 c.userRepos[username] = hash
219
220 return nil
221}
222
223// SetOrgHash will set the hash of the given org repo to use when loading.
224func (c *Config) SetOrgHash(orgName, hash string) error {

Callers 1

runUpdateHookMethod · 0.95

Calls 2

EnsureRepoFunction · 0.92
CheckoutMethod · 0.80

Tested by

no test coverage detected