ccollins476ad commented on a change in pull request #340: newt upgrade: Fix
Repo Commit Checkout
URL: https://github.com/apache/mynewt-newt/pull/340#discussion_r334289986
##########
File path: newt/install/install.go
##########
@@ -647,17 +647,29 @@ func (inst *Installer) calcVersionMap(candidates
[]*repo.Repo) (
}
// If project.yml specified any specific git commits, ensure we get
them.
+ rg := dg.Reverse()
for name, ver := range vm {
- reqs := inst.reqs[name]
- if len(reqs) > 0 {
- keep, err := inst.shouldKeepCommit(name,
reqs[0].Ver.Commit)
- if err != nil {
- return nil, err
- }
- if keep {
- ver.Commit = reqs[0].Ver.Commit
+ for _, node := range rg[name] {
+ if len(node.VerReqs) > 0 {
+ // look at all elements of VerReqs array
Review comment:
This is 100% a nit pick so feel free to ignore it. I find comments like
this one don't provide much signal vs. noise. I.e., we can tell from the next
line that we are looping over the `VerReqs` slice, so no need to say it twice.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services