Skip to content

Commit ead48a2

Browse files
authored
Omit the branch name when matching packages in manifest.json (#131)
1 parent f64d170 commit ead48a2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/kup/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ def reload_packages(load_versions: bool = True) -> None:
275275
if 'attrPath' in m and m['attrPath']:
276276
available_package = lookup_available_package(m['attrPath'])
277277
if available_package is not None:
278-
repo_path, _ = available_package.repo_path_with_access()
279-
if 'url' in m and m['url'].startswith(repo_path):
278+
base_repo_path = available_package.base_repo_path
279+
if 'url' in m and m['url'].startswith(base_repo_path):
280280
packages[available_package.package_name.base] = ConcretePackage.parse(
281281
m['url'], available_package, idx, load_versions
282282
)

src/kup/package.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def uri(self) -> str:
115115
path, _ = self.repo_path_with_access()
116116
return f'{path}#{self.package_name}'
117117

118+
@property
119+
def base_repo_path(self) -> str:
120+
return f'github:{self.org}/{self.repo}'
121+
118122
def concrete(
119123
self, override_branch_tag_commit_or_path: Optional[str] = None, ext: Optional[Iterable[str]] = None
120124
) -> Union['ConcretePackage', 'LocalPackage']:

0 commit comments

Comments
 (0)