Skip to content

Commit 130bbe0

Browse files
committed
Fixed modified context when committing
- Resets the context before committing and tagging - Fixes #14
1 parent a98936a commit 130bbe0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bumpversion/bump.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ def do_bump(
8181

8282
configured_files = resolve_file_config(config.files, config.version_config)
8383
modify_files(configured_files, version, next_version, ctx, dry_run)
84-
8584
update_config_file(config_file, config.current_version, next_version_str, dry_run)
8685

86+
ctx = get_context(config, version, next_version)
87+
ctx["new_version"] = next_version_str
8788
commit_and_tag(config, config_file, configured_files, ctx, dry_run)
8889

8990

bumpversion/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def get_context(
4040
{c: c for c in ("#", ";")},
4141
)
4242
if current_version:
43-
ctx.new_child({f"current_{part}": current_version[part].value for part in current_version})
43+
ctx = ctx.new_child({f"current_{part}": current_version[part].value for part in current_version})
4444
if new_version:
45-
ctx.new_child({f"new_{part}": new_version[part].value for part in new_version})
45+
ctx = ctx.new_child({f"new_{part}": new_version[part].value for part in new_version})
4646
return ctx
4747

4848

0 commit comments

Comments
 (0)