diff --git a/src/pycalver/cli.py b/src/pycalver/cli.py index 0abd8c5..3fe5b4b 100755 --- a/src/pycalver/cli.py +++ b/src/pycalver/cli.py @@ -214,12 +214,13 @@ def _assert_not_dirty(_vcs: vcs.VCS, filepaths: typ.Set[str], allow_dirty: bool) def _bump(cfg: config.Config, new_version: str, allow_dirty: bool = False) -> None: _vcs: typ.Optional[vcs.VCS] - - try: - _vcs = vcs.get_vcs() - except OSError: - log.warning("Version Control System not found, aborting commit.") - _vcs = None + + if cfg.commit: + try: + _vcs = vcs.get_vcs() + except OSError: + log.warning("Version Control System not found, aborting commit.") + _vcs = None filepaths = set(cfg.file_patterns.keys())