diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-12-16 15:13:17 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-12-17 10:44:11 +0100 |
commit | 35343b1950d1afc609c77ded728fba1e315a2e28 (patch) | |
tree | e5ecc721519d7bffac643e3f02eecac2c14568d8 /bin | |
parent | 99b3f6baf7ec1159c95ccc6c03208aee91b61e8e (diff) | |
download | justbuild-35343b1950d1afc609c77ded728fba1e315a2e28.tar.gz |
just-lock: Fix plain configuration map for 'git' imports
While there, also improve check for early return from import
method.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/just-lock.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/just-lock.py b/bin/just-lock.py index 7cd47105..2ecc1cc3 100755 --- a/bin/just-lock.py +++ b/bin/just-lock.py @@ -431,10 +431,6 @@ def git_checkout(url: str, branch: str, *, commit: Optional[str], def import_from_git(core_repos: Json, imports_entry: Json) -> Json: """Handles imports from Git repositories.""" - # Check if anything is to be done - if not imports_entry.get("repos", []): - return core_repos - # Set granular logging message fail_context: str = "While importing from source \"git\":\n" @@ -445,6 +441,10 @@ def import_from_git(core_repos: Json, imports_entry: Json) -> Json: "Expected field \"repos\" to be a list, but found:\n%r" % (json.dumps(repos, indent=2), )) + # Check if anything is to be done + if not repos: # empty + return core_repos + # Parse source config fields url: str = imports_entry.get("url", None) if not isinstance(url, str): @@ -504,7 +504,7 @@ def import_from_git(core_repos: Json, imports_entry: Json) -> Json: DEFAULT_JUSTMR_CONFIG_NAME, srcdir) foreign_config: Json = {} if as_plain: - foreign_config = {"main": "", **DEFAULT_REPO} + foreign_config = {"main": "", "repositories": DEFAULT_REPO} else: if (foreign_config_file): try: |