#!/bin/sh

set -e

. ./helpers.sh

# When rmadison fails, the dch wrapper must fall back to appending the
# bullets to the current (unbumped) changelog entry.

set_stub_rmadison "" 1
make_fixture "1.0.0-1" unstable "openstack-pkg-tools" \
	"UPSTREAM_GIT := https://github.com/openstack/openstack-pkg-tools.git"

run_modernize
assert_eq "exit code" "${MODERNIZE_RC}" "0"
assert_eq "version kept" "$(dpkg-parsechangelog -SVersion)" "1.0.0-1"
assert_contains "bullet appended" "$(cat debian/changelog)" "* Update debian/salsa-ci.yml"
assert_eq "commit count" "$(git log --format=%s | wc -l)" "6"

exit 0
