]> rtime.felk.cvut.cz Git - git.git/commitdiff
Merge branch 'da/mergetool-tests'
authorJunio C Hamano <gitster@pobox.com>
Tue, 21 Oct 2014 20:28:14 +0000 (13:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Oct 2014 20:28:14 +0000 (13:28 -0700)
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

1  2 
t/test-lib-functions.sh

index b7957b87bb9602748d6f84eeaaeb3c6820b1142e,6bb7e9767b643899f15db176379f8fa2bd794e4c..0d93e33de4759bff71739c19be803cac981f0770
@@@ -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"