diff options
author | Michael Muré <batolettre@gmail.com> | 2022-12-22 23:19:31 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2022-12-23 01:41:03 +0100 |
commit | 95911100823b5c809225d664de74ad2d64e91972 (patch) | |
tree | c352848904d82b046646b4074f26b0ce5235fa40 /cache/multi_repo_cache.go | |
parent | d65e8837aa7bb1a6abb6892b9f2664e1b7edb02e (diff) | |
download | git-bug-95911100823b5c809225d664de74ad2d64e91972.tar.gz |
cache: fix some bugs after refactor
Diffstat (limited to 'cache/multi_repo_cache.go')
-rw-r--r-- | cache/multi_repo_cache.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cache/multi_repo_cache.go b/cache/multi_repo_cache.go index 12d26e26..007737ad 100644 --- a/cache/multi_repo_cache.go +++ b/cache/multi_repo_cache.go @@ -21,13 +21,13 @@ func NewMultiRepoCache() *MultiRepoCache { } // RegisterRepository register a named repository. Use this for multi-repo setup -func (c *MultiRepoCache) RegisterRepository(ref string, repo repository.ClockedRepo) (*RepoCache, chan BuildEvent, error) { - r, events, err := NewRepoCache(repo) +func (c *MultiRepoCache) RegisterRepository(name string, repo repository.ClockedRepo) (*RepoCache, chan BuildEvent, error) { + r, events, err := NewNamedRepoCache(repo, name) if err != nil { return nil, nil, err } - c.repos[ref] = r + c.repos[name] = r return r, events, nil } @@ -55,9 +55,9 @@ func (c *MultiRepoCache) DefaultRepo() (*RepoCache, error) { panic("unreachable") } -// ResolveRepo retrieve a repository with a reference -func (c *MultiRepoCache) ResolveRepo(ref string) (*RepoCache, error) { - r, ok := c.repos[ref] +// ResolveRepo retrieve a repository by name +func (c *MultiRepoCache) ResolveRepo(name string) (*RepoCache, error) { + r, ok := c.repos[name] if !ok { return nil, fmt.Errorf("unknown repo") } |