Skip to content

Commit

Permalink
Fixed modified context when committing
Browse files Browse the repository at this point in the history
- Resets the context before committing and tagging
- Fixes #14
  • Loading branch information
coordt committed Aug 7, 2023
1 parent a98936a commit 130bbe0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bumpversion/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ def do_bump(

configured_files = resolve_file_config(config.files, config.version_config)
modify_files(configured_files, version, next_version, ctx, dry_run)

update_config_file(config_file, config.current_version, next_version_str, dry_run)

ctx = get_context(config, version, next_version)
ctx["new_version"] = next_version_str
commit_and_tag(config, config_file, configured_files, ctx, dry_run)


Expand Down
4 changes: 2 additions & 2 deletions bumpversion/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def get_context(
{c: c for c in ("#", ";")},
)
if current_version:
ctx.new_child({f"current_{part}": current_version[part].value for part in current_version})
ctx = ctx.new_child({f"current_{part}": current_version[part].value for part in current_version})
if new_version:
ctx.new_child({f"new_{part}": new_version[part].value for part in new_version})
ctx = ctx.new_child({f"new_{part}": new_version[part].value for part in new_version})
return ctx


Expand Down

0 comments on commit 130bbe0

Please sign in to comment.