MCPcopy Index your code
hub / github.com/git-bug/git-bug / SetUserIdentity

Method SetUserIdentity

cache/repo_cache_common.go:156–173  ·  view source on GitHub ↗
(i *IdentityCache)

Source from the content-addressed store, hash-verified

154}
155
156func (c *RepoCache) SetUserIdentity(i *IdentityCache) error {
157 c.muUserIdentity.RLock()
158 defer c.muUserIdentity.RUnlock()
159
160 // Make sure that everything is fine
161 if _, err := c.identities.Resolve(i.Id()); err != nil {
162 panic("SetUserIdentity while the identity is not from the cache, something is wrong")
163 }
164
165 err := identity.SetUserIdentity(c.repo, i.Identity)
166 if err != nil {
167 return err
168 }
169
170 c.userIdentityId = i.Id()
171
172 return nil
173}
174
175func (c *RepoCache) ClearUserIdentity() error {
176 c.muUserIdentity.Lock()

Callers 11

TestCacheFunction · 0.80
TestCachePushPullFunction · 0.80
TestRemoveFunction · 0.80
TestCacheEvictionFunction · 0.80
FinishConfigFunction · 0.80
TestGithubPushPullFunction · 0.80
TestGitlabPushPullFunction · 0.80
runUserAdoptFunction · 0.80
runUserNewFunction · 0.80
NewTestEnvAndUserFunction · 0.80
TestGitFileHandlersFunction · 0.80

Calls 3

SetUserIdentityFunction · 0.92
ResolveMethod · 0.65
IdMethod · 0.65

Tested by 7

TestCacheFunction · 0.64
TestCachePushPullFunction · 0.64
TestRemoveFunction · 0.64
TestCacheEvictionFunction · 0.64
TestGithubPushPullFunction · 0.64
TestGitlabPushPullFunction · 0.64
TestGitFileHandlersFunction · 0.64