Skip to content

Commit

Permalink
fix: fix wrong kwarg name for repo url in MkNode.with_context
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 14, 2023
1 parent cf9f7a2 commit adbf7c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mknodes/basenodes/mknode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ def with_context(
**kwargs,
):
"""Same as the Ctor, but auto-adds a context for the repo url (or the cwd)."""
context = contexts.ProjectContext.for_config(repo=repo_url, base_url=base_url)
return cls(*args, **kwargs, context=context)
ctx = contexts.ProjectContext.for_config(repo_url=repo_url, base_url=base_url)
return cls(*args, **kwargs, context=ctx)

def to_html(self) -> str:
"""Convert node to HTML using the resources from node + children."""
Expand Down
2 changes: 1 addition & 1 deletion mknodes/info/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def for_config(
include_stdlib=True,
)
git_repo = reporegistry.get_repo(
str(cfg.get("repo_url", ".")),
cfg.get("repo_url") or ".",
clone_depth=cfg.get("clone_depth", 100),
)
folderinfo = fi.FolderInfo(git_repo.working_dir)
Expand Down
2 changes: 1 addition & 1 deletion mknodes/info/gitrepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GitRepository(git.Repo):
"""Aggregates information about a git repo."""

def __init__(self, path: str | os.PathLike | None = None, **kwargs):
super().__init__(path, **kwargs)
super().__init__(path or ".", **kwargs)
# to keep a reference to a TempDirectory instance
self.temp_directory: tempfile.TemporaryDirectory | None = None

Expand Down

0 comments on commit adbf7c1

Please sign in to comment.