Skip to content

Commit 8492d42

Browse files
committed
Fix loading _manifest in a project git
1 parent 8c2336d commit 8492d42

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

osc/git_scm/store.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)