From: Junio C Hamano Date: Tue, 21 Oct 2014 20:28:14 +0000 (-0700) Subject: Merge branch 'da/mergetool-tests' X-Git-Tag: v2.2.0-rc0~31 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/64bff25f78da5ae2e64f0598df20370c45aad7ef Merge branch 'da/mergetool-tests' The clean-up of this test script was long overdue and is a very welcome change. * da/mergetool-tests: test-lib-functions: adjust style to match CodingGuidelines t7610-mergetool: use test_config to isolate tests t7610-mergetool: add missing && and remove commented-out code t7610-mergetool: use tabs instead of a mix of tabs and spaces --- 64bff25f78da5ae2e64f0598df20370c45aad7ef diff --cc t/test-lib-functions.sh index b7957b87bb,6bb7e9767b..0d93e33de4 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@@ -489,19 -491,8 +491,19 @@@ test_path_is_dir () fi } +# Check if the directory exists and is empty as expected, barf otherwise. +test_dir_is_empty () { + test_path_is_dir "$1" && + if test -n "$(ls -a1 "$1" | egrep -v '^\.\.?$')" + then + echo "Directory '$1' is not empty, it contains:" + ls -la "$1" + return 1 + fi +} + test_path_is_missing () { - if [ -e "$1" ] + if test -e "$1" then echo "Path exists:" ls -ld "$1"