Skip to content

Commit

Permalink
remove not needed changes
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Kumar <[email protected]>
  • Loading branch information
AkashKumar7902 committed May 14, 2024
1 parent 030d434 commit c9675cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ func (c *KpmClient) InitGraphAndDownloadDeps(kclPkg *pkg.KclPkg) (*pkg.Dependenc
return nil, nil, err
}

changedDeps, err := c.DownloadDeps(kclPkg.ModFile.Dependencies, kclPkg.Dependencies, depGraph, kclPkg.HomePath, root)
changedDeps, err := c.DownloadDeps(&kclPkg.ModFile.Dependencies, &kclPkg.Dependencies, depGraph, kclPkg.HomePath, root)
if err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -1325,7 +1325,7 @@ func (c *KpmClient) dependencyExists(dep *pkg.Dependency, lockDeps *pkg.Dependen
}

// downloadDeps will download all the dependencies of the current kcl package.
func (c *KpmClient) DownloadDeps(deps pkg.Dependencies, lockDeps pkg.Dependencies, depGraph graph.Graph[module.Version, module.Version], pkghome string, parent module.Version) (*pkg.Dependencies, error) {
func (c *KpmClient) DownloadDeps(deps *pkg.Dependencies, lockDeps *pkg.Dependencies, depGraph graph.Graph[module.Version, module.Version], pkghome string, parent module.Version) (*pkg.Dependencies, error) {

newDeps := pkg.Dependencies{
Deps: make(map[string]pkg.Dependency),
Expand All @@ -1337,7 +1337,7 @@ func (c *KpmClient) DownloadDeps(deps pkg.Dependencies, lockDeps pkg.Dependencie
return nil, errors.InvalidDependency
}

existDep := c.dependencyExists(&d, &lockDeps)
existDep := c.dependencyExists(&d, lockDeps)
if existDep != nil {
newDeps.Deps[d.Name] = *existDep
continue
Expand Down Expand Up @@ -1424,7 +1424,7 @@ func (c *KpmClient) DownloadDeps(deps pkg.Dependencies, lockDeps pkg.Dependencie
}

// Download the indirect dependencies.
nested, err := c.DownloadDeps(deppkg.ModFile.Dependencies, lockDeps, depGraph, deppkg.HomePath, source)
nested, err := c.DownloadDeps(&deppkg.ModFile.Dependencies, lockDeps, depGraph, deppkg.HomePath, source)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/mvs/mvs.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (r ReqsGraph) Upgrade(m module.Version) (module.Version, error) {
lockDeps := pkg.Dependencies{
Deps: make(map[string]pkg.Dependency),
}
_, err = r.kpmClient.DownloadDeps(deps, lockDeps, r.Graph, r.kpmPkg.HomePath, module.Version{})
_, err = r.kpmClient.DownloadDeps(&deps, &lockDeps, r.Graph, r.kpmPkg.HomePath, module.Version{})
if err != nil {
return module.Version{}, err
}
Expand Down Expand Up @@ -140,7 +140,7 @@ func (r ReqsGraph) Previous(m module.Version) (module.Version, error) {
lockDeps := pkg.Dependencies{
Deps: make(map[string]pkg.Dependency),
}
_, err = r.kpmClient.DownloadDeps(deps, lockDeps, r.Graph, r.kpmPkg.HomePath, module.Version{})
_, err = r.kpmClient.DownloadDeps(&deps, &lockDeps, r.Graph, r.kpmPkg.HomePath, module.Version{})
if err != nil {
return module.Version{}, err
}
Expand Down

0 comments on commit c9675cd

Please sign in to comment.