#!/bin/sh

set -e

. ./helpers.sh

# pkgos-modernize must refuse to run when the git working tree is not
# clean, so that each operation always produces an atomic commit.

set_stub_rmadison "" 0
make_fixture "1.0.0-1" unstable "openstack-pkg-tools" \
	"UPSTREAM_GIT := https://github.com/openstack/openstack-pkg-tools.git"
printf 'junk\n' > junk.txt

run_modernize
assert_eq "exit code" "${MODERNIZE_RC}" "1"
assert_contains "error message" "${OUT}" "the git working tree is not clean"
assert_eq "no commit" "$(git log --format=%s | wc -l)" "1"

exit 0
