Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit c7ae7f2

Browse files
committed
Use OL lookup to check if we have a new project
1 parent c2ddece commit c7ae7f2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

cmd/dep/root_analyzer.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,10 @@ func (a *rootAnalyzer) FinalizeRootManifestAndLock(m *dep.Manifest, l *dep.Lock,
179179
var f *fb.ConstraintFeedback
180180
pr := y.Ident().ProjectRoot
181181

182-
if op, ok := olLookup[pr]; ok {
182+
op, inOl := olLookup[pr]
183+
if inOl {
183184
if diff := gps.DiffProjects(y, op); diff != nil {
184-
fmt.Printf("Some changes: \nImported: %v\nRevised: %v\nDiff: %v\n", y, op, diff)
185+
fmt.Printf("Some changes: \nImported: %v\nRevised: %v\nDiff: %+v\n", y, op, diff)
185186
}
186187
}
187188
// New constraints: in new lock and dir dep but not in manifest
@@ -199,12 +200,7 @@ func (a *rootAnalyzer) FinalizeRootManifestAndLock(m *dep.Manifest, l *dep.Lock,
199200
}
200201
} else {
201202
// New locked projects: in new lock but not in old lock
202-
newProject := true
203-
for _, opl := range ol.Projects() {
204-
if pr == opl.Ident().ProjectRoot {
205-
newProject = false
206-
}
207-
}
203+
newProject := !inOl
208204
if newProject {
209205
f = fb.NewLockedProjectFeedback(y, fb.DepTypeTransitive)
210206
f.LogFeedback(a.ctx.Err)

0 commit comments

Comments
 (0)