From cf9a2a2a76b332c89fef40e47f7ddb4e8c817ab9 Mon Sep 17 00:00:00 2001 From: Kaushik Lingarkar Date: Tue, 17 Dec 2024 12:49:14 -0800 Subject: Update internal filesystem layout for submodules Change the bare checkout directory for submodules from 'subprojects' to 'modules'. Git expects bare submodule checkouts to be in the 'modules' directory. If old subproject directories are found, they will be migrated to the new modules directory. This change is the first step in ensuring Git can understand repo's submodules to some extent. Change-Id: I385029f1bb55d040616d970d6ffb4bb856692520 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/444881 Tested-by: Kaushik Lingarkar Reviewed-by: Josip Sokcevic --- manifest_xml.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'manifest_xml.py') diff --git a/manifest_xml.py b/manifest_xml.py index cdab31e6..347ae5ef 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -2056,7 +2056,12 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md path = path.rstrip("/") name = name.rstrip("/") relpath = self._JoinRelpath(parent.relpath, path) - gitdir = os.path.join(parent.gitdir, "subprojects", "%s.git" % path) + subprojects = os.path.join(parent.gitdir, "subprojects", f"{path}.git") + modules = os.path.join(parent.gitdir, "modules", path) + if platform_utils.isdir(subprojects): + gitdir = subprojects + else: + gitdir = modules objdir = os.path.join( parent.gitdir, "subproject-objects", "%s.git" % name ) -- cgit v1.2.3-54-g00ecf