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

Method SetHash

config.go:190–204  ·  view source on GitHub ↗

SetHash will set the hash of the admin repo to use when loading.

(hash string)

Source from the content-addressed store, hash-verified

188
189// SetHash will set the hash of the admin repo to use when loading.
190func (c *Config) SetHash(hash string) error {
191 adminRepo, err := git.EnsureRepo(c.fs, "admin/admin")
192 if err != nil {
193 return err
194 }
195
196 err = adminRepo.Checkout(hash)
197 if err != nil {
198 return err
199 }
200
201 c.adminRepoHash = hash
202
203 return nil
204}
205
206// SetUserHash will set the hash of the given user repo to use when loading.
207func (c *Config) SetUserHash(username, hash string) error {

Callers 1

runUpdateHookMethod · 0.95

Calls 2

EnsureRepoFunction · 0.92
CheckoutMethod · 0.80

Tested by

no test coverage detected