This is an automated email from the ASF dual-hosted git repository.
sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git
The following commit(s) were added to refs/heads/master by this push:
new 461da719 newt/project: Follow version deps for commit pinned repos
461da719 is described below
commit 461da719dbe02f1a9254bdae7b97fd6a14c9e750
Author: Szymon Janc <[email protected]>
AuthorDate: Fri Oct 16 14:39:50 2026 +0200
newt/project: Follow version deps for commit pinned repos
A repo pinned to a commit hash (e.g. "<sha>-commit") had all its
dependencies followed while loading the project, including those
listed only for old releases. This cloned repos that were not used,
e.g. apache-mynewt-mcumgr for core pinned to a master commit in CI.
Ignore the commit and map the requirement's version number instead,
as Repo.DepsForVersion does during install. All dependencies are
still followed if the version cannot be mapped.
Assisted-by: Claude:claude-opus-5-5
---
newt/project/project.go | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/newt/project/project.go b/newt/project/project.go
index a5e8336c..e782edd3 100644
--- a/newt/project/project.go
+++ b/newt/project/project.go
@@ -548,9 +548,10 @@ func (proj *Project) checkNewtVer() error {
}
// Returns the dependencies of a repo that apply to the specified version
-// requirements. If a requirement cannot be mapped to a `repository.yml`
-// commit (e.g., it is a commit hash or the version is unknown), all
-// dependencies are returned.
+// requirements. A commit hash requirement is treated like its version
+// number, as during install (see Repo.DepsForVersion). If a requirement
+// cannot be mapped to a `repository.yml` commit (e.g., the version is
+// unknown), all dependencies are returned.
func repoDepsForReqs(r *repo.Repo,
verReqs []newtutil.RepoVersion) []*repo.RepoDependency {
@@ -560,9 +561,7 @@ func repoDepsForReqs(r *repo.Repo,
var deps []*repo.RepoDependency
for _, verReq := range verReqs {
- if verReq.Commit != "" {
- return r.AllDeps()
- }
+ verReq.Commit = ""
commit, err := r.CommitFromVer(verReq)
if err != nil {