Skip to content

Commit c6781b8

Browse files
committed
Fixed a logic error when generating incremental changelogs
1 parent 1c26a65 commit c6781b8

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

generate_changelog/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ def main(
101101
release_hint = suggest_release_type(current_branch.name, version_contexts, config)
102102

103103
# use the output pipeline to deal with the rendered change log.
104-
rendered_chglog = templating.render_changelog(version_contexts, config, not starting_tag)
104+
has_starting_tag = bool(starting_tag)
105+
rendered_chglog = templating.render_changelog(version_contexts, config, has_starting_tag)
105106

106107
if not skip_output_pipeline:
107108
echo_func("Executing output pipeline.")

test/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_app_generate_notes(default_repo):
5959
print(result.stdout)
6060
traceback.print_exception(*result.exc_info)
6161
assert result.exit_code == 0
62-
assert result.stdout.startswith("## Unreleased")
62+
assert result.stdout.startswith("# Changelog")
6363

6464

6565
def test_app_generate_all(default_repo):
@@ -70,5 +70,5 @@ def test_app_generate_all(default_repo):
7070
traceback.print_exception(*result.exc_info)
7171
assert result.exit_code == 0
7272
output = json.loads(result.stdout)
73-
assert output["notes"].startswith("## Unreleased")
73+
assert output["notes"].startswith("# Changelog")
7474
assert "minor" == output["release_hint"]

0 commit comments

Comments
 (0)