You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/01/15 09:11:14 UTC

[GitHub] [mynewt-newt] utzig commented on a change in pull request #363: newt upgrade: Fix repo conflict error message

utzig commented on a change in pull request #363: newt upgrade: Fix repo conflict error message
URL: https://github.com/apache/mynewt-newt/pull/363#discussion_r366762604
 
 

 ##########
 File path: newt/deprepo/deprepo.go
 ##########
 @@ -236,15 +236,20 @@ func PruneMatrix(m *Matrix, repos RepoMap, rootReqs RequirementMap) error {
 // of repos in the project.
 func PruneDepGraph(dg DepGraph, keep []*repo.Repo) {
 	for k, _ := range dg {
-		found := false
-		for _, r := range keep {
-			if r.Name() == k.Name {
-				found = true
-				break
+		// The empty string indicates a `project.yml` requirement.  Always
+		// keep these.
+		if k.Name != "" {
+			found := false
+
+			for _, r := range keep {
+				if k.Name == "" || k.Name == r.Name() {
 
 Review comment:
   If `k.Name != ""` in the test above can it ever be `== ""` here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services