check for vcs only if commit enabled

This commit is contained in:
Valentin 2020-07-18 00:12:58 +00:00
parent 8d7b09e13d
commit 2f1d6aa2d2

View file

@ -215,11 +215,12 @@ 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())