diff --git a/bumpversion/bump.py b/bumpversion/bump.py index 851e9617..d1636d40 100644 --- a/bumpversion/bump.py +++ b/bumpversion/bump.py @@ -136,12 +136,12 @@ def commit_and_tag( Args: config: The configuration - config_file: The configuration file to include in the commit, if it exists + config_file: The configuration file to include in the commit if it exists configured_files: A list of files to commit ctx: The context used to render the tag and tag message dry_run: True if the operation should be a dry run """ - if not config.scm_info or not config.scm_info.tool: + if not config.scm_info or not config.scm_info.tool: # pragma: no-coverage return commit_files = {f.file_change.filename for f in configured_files} diff --git a/bumpversion/utils.py b/bumpversion/utils.py index 57219f82..57cb2539 100644 --- a/bumpversion/utils.py +++ b/bumpversion/utils.py @@ -131,4 +131,8 @@ def run_command(command: list, env: Optional[dict] = None) -> CompletedProcess: def is_subpath(parent: Path | str, path: Path | str) -> bool: """Return whether a path is inside the parent.""" - return str(path).startswith(str(parent)) if Path(path).is_absolute() else True + normalized_parent = Path(parent).resolve() + normalized_path = Path(path).resolve() + print(f"normalized_parent: {normalized_parent}") + print(f"normalized_path: {normalized_path}") + return str(normalized_path).startswith(str(normalized_parent)) if normalized_path.is_absolute() else True