@@ -135,22 +135,23 @@ def __init__(self, path: str, *, check: bool = True):
135135 break
136136
137137 if self .type == "project" :
138- if self ._git .topdir != self .abspath :
139- manifest_path = os .path .join (self ._git .topdir , "_manifest" )
140- subdirs_path = os .path .join (self ._git .topdir , "_subdirs" )
138+ manifest_path = os .path .join (self ._git .topdir , "_manifest" )
139+ subdirs_path = os .path .join (self ._git .topdir , "_subdirs" )
141140
142- if os .path .exists (manifest_path ):
143- self .manifest = Manifest .from_file (manifest_path )
144- elif os .path .exists (subdirs_path ):
145- self .manifest = Subdirs .from_file (subdirs_path )
146- else :
147- # empty manifest considers all top-level directories as packages
148- self .manifest = Manifest ()
141+ if os .path .exists (manifest_path ):
142+ self .manifest = Manifest .from_file (manifest_path )
143+ elif os .path .exists (subdirs_path ):
144+ self .manifest = Subdirs .from_file (subdirs_path )
145+ else :
146+ # empty manifest considers all top-level directories as packages
147+ self .manifest = Manifest ({} )
149148
149+ if self ._git .topdir != self .abspath :
150150 package_topdir = self .manifest .resolve_package_path (project_path = self ._git .topdir , package_path = self .abspath )
151151 if package_topdir :
152152 self ._type = "package"
153153 self ._topdir = package_topdir
154+ self .manifest = None
154155
155156 self .project_store = None
156157 if self .type == "package" :
0 commit comments