git: manifest: always use .repo/manifests/ for the include dir

Even if the manifest lives at .repo/manifests.xml, repo will use
.repo/manifests/ to process include directives.  Stop assuming that
.repo/manifests.xml is a symlink pointing to the actual manifest
dir that we can follow.

TEST=`./run_tests` pass

Change-Id: I449c0953277de3428c67ce8a816b8eb5371ee5c0
Reviewed-by: Sean Abraham <>
Commit-Queue: Sean Abraham <>
Tested-by: Sean Abraham <>
Reviewed-by: Mike Frysinger <>
Tested-by: Mike Frysinger <>
diff --git a/lib/ b/lib/
index b2ed600..ebe17c9 100644
--- a/lib/
+++ b/lib/
@@ -583,7 +583,9 @@
         path, manifest_path, search=search)
     self.manifest_path = os.path.realpath(manifest_path)
-    manifest_include_dir = os.path.dirname(self.manifest_path)
+    # The include dir is always the manifest repo, not where the manifest file
+    # happens to live.
+    manifest_include_dir = os.path.join(self.root, '.repo', 'manifests')
     self.manifest_branch = self._GetManifestsBranch(self.root)
     self._content_merging = {}
     Manifest.__init__(self, self.manifest_path,