update vcs option cascade

- use cfg.commit explicitly (this condition was previously only
  implicit, because the function isn't called in the first place
  if cfg.commit is False
- allow push even with tag=False
This commit is contained in:
Manuel Barkhau 2021-11-07 11:54:20 +00:00 committed by mbarkhau
parent 52af1e554e
commit 0a109aad21

View file

@ -225,15 +225,16 @@ def commit(
new_version : str,
commit_message: str,
) -> None:
for filepath in filepaths:
vcs_api.add(filepath)
if cfg.commit:
for filepath in filepaths:
vcs_api.add(filepath)
vcs_api.commit(commit_message)
vcs_api.commit(commit_message)
if cfg.commit and cfg.tag:
vcs_api.tag(new_version)
if cfg.commit and cfg.tag and cfg.push:
if cfg.commit and cfg.push:
vcs_api.push(new_version)