Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bugs with adding URL at specific commit #95

Merged
merged 5 commits into from
Feb 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cfbs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def get_module_object(self, name, added_by=None):
return module


def _construct_provided_module(name, data, url, url_commit):
def _construct_provided_module(name, data, url, commit):
assert "@" not in url # Should already be split into url and commit
module = OrderedDict()
module["name"] = name
if "description" not in data:
Expand All @@ -166,7 +167,7 @@ def _construct_provided_module(name, data, url, url_commit):
)
module["description"] = data["description"]
module["url"] = url
module["commit"] = url_commit
module["commit"] = commit
subdirectory = data.get("subdirectory")
if subdirectory:
module["subdirectory"] = subdirectory
Expand Down Expand Up @@ -329,6 +330,10 @@ def _add_using_url(
assert url.startswith(("https://", "git://", "ssh://"))
config_path, url_commit = clone_url_repo(url)

if "@" in url:
assert url.split("@")[1] == url_commit
url = url.split("@")[0]

remote_config = CFBSJson(path=config_path, url=url, url_commit=url_commit)

provides = remote_config.get_provides()
Expand Down