From 0a109aad21cf5c4fa970377abab3cc57c72bc1ab Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Sun, 7 Nov 2021 11:54:20 +0000 Subject: [PATCH] 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 --- src/bumpver/vcs.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bumpver/vcs.py b/src/bumpver/vcs.py index 04aa5c0..083d77c 100644 --- a/src/bumpver/vcs.py +++ b/src/bumpver/vcs.py @@ -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)