]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
devtool: avoid recursion into nested git repos with submodules
authorClement Faure <clement.faure@arm.com>
Thu, 12 Feb 2026 10:38:02 +0000 (11:38 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Feb 2026 18:05:10 +0000 (18:05 +0000)
Prevent devtool from recursing into nested git repositories with
submodules to avoid double git submodule add operation.

Signed-off-by: Clement Faure <clement.faure@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/__init__.py

index 7c8de5540c1c4ed97400f6ecbe0ea68877823440..cb727f324f426bbdf68756a7faed07e9f6c406e8 100644 (file)
@@ -249,6 +249,10 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None):
                     remote_url = stdout.splitlines()[0]
                     logger.error(os.path.relpath(os.path.join(root, ".."), root))
                     bb.process.run('git submodule add %s %s' % (remote_url, os.path.relpath(root, os.path.join(root, ".."))), cwd=os.path.join(root, ".."))
+                    # Do not descend into nested git repos that have submodules themselves.
+                    if ".gitmodules" in files:
+                        logger.warning('Nested git repository with submodules %s; devtool will not recurse into it', root)
+                        dirs[:] = []
                     found = True
                 if found:
                     oe.patch.GitApplyTree.commitIgnored("Add additional submodule from SRC_URI", dir=os.path.join(root, ".."), d=d)