Skip to content

Commit

Permalink
Merge pull request #120 from Nordix/cache-confusing-else
Browse files Browse the repository at this point in the history
Remove confusing else statement in cache.go
  • Loading branch information
nephio-prow[bot] authored Oct 9, 2024
2 parents c5599d6 + 02c618a commit a3d7d29
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,19 @@ func (c *Cache) OpenRepository(ctx context.Context, repositorySpec *configapi.Re
} else {
mbs = git.ErrorIfMissing
}
if r, err := git.OpenRepository(ctx, repositorySpec.Name, repositorySpec.Namespace, gitSpec, repositorySpec.Spec.Deployment, filepath.Join(c.cacheDir, "git"), git.GitRepositoryOptions{

r, err := git.OpenRepository(ctx, repositorySpec.Name, repositorySpec.Namespace, gitSpec, repositorySpec.Spec.Deployment, filepath.Join(c.cacheDir, "git"), git.GitRepositoryOptions{
CredentialResolver: c.credentialResolver,
UserInfoProvider: c.userInfoProvider,
MainBranchStrategy: mbs,
UseGitCaBundle: c.useGitCaBundle,
}); err != nil {
})
if err != nil {
return nil, err
} else {
cachedRepo = newRepository(key, repositorySpec, r, c.objectNotifier, c.metadataStore, c.repoSyncFrequency)
c.repositories[key] = cachedRepo
}

cachedRepo = newRepository(key, repositorySpec, r, c.objectNotifier, c.metadataStore, c.repoSyncFrequency)
c.repositories[key] = cachedRepo
} else {
// If there is an error from the background refresh goroutine, return it.
if err := cachedRepo.getRefreshError(); err != nil {
Expand Down

0 comments on commit a3d7d29

Please sign in to comment.