#!/bin/sh
# Check for when there's a one-line ChangeLog entry but no diffs
# to the named file.

. "${srcdir=.}/init.sh"; path_prepend_ ..
print_ver_ vc-dwim

require_git_

cat <<EOF > ChangeLog || framework_failure_
2006-09-04  Jim Meyering  <jim@meyering.net>

	* foo: bar.

EOF
git init > /dev/null || framework_failure_
git add . || framework_failure_
git commit -m m . > /dev/null || framework_failure_

set -e

cat <<EOF > ChangeLog
2006-09-04  Jim Meyering  <jim@meyering.net>

	* not-mod: x
	* foo: bar.

EOF

vc-dwim ChangeLog > out 2>&1 && false

cat <<\EOF > exp
vc-dwim: not-mod is listed in the ChangeLog entry, but not in diffs.
Did you forget to add it?
EOF

compare exp out

Exit 0
