Merge branch 'fc/show-non-empty-errors-in-test'

* fc/show-non-empty-errors-in-test:
  test: test_must_be_empty helper
This commit is contained in:
Junio C Hamano
2013-06-20 16:02:24 -07:00
9 changed files with 65 additions and 53 deletions

View File

@ -609,6 +609,18 @@ test_cmp() {
$GIT_TEST_CMP "$@"
}
# Check if the file expected to be empty is indeed empty, and barfs
# otherwise.
test_must_be_empty () {
if test -s "$1"
then
echo "'$1' is not empty, it contains:"
cat "$1"
return 1
fi
}
# Tests that its two parameters refer to the same revision
test_cmp_rev () {
git rev-parse --verify "$1" >expect.rev &&