Merge branch 'jw/gitweb-sample-update'
[gitweb.git] / t / test-lib-functions.sh
index 8270de74beafb931f09f296557406c0d158d48de..7308f679229044030336922515a4e2870e6451d1 100644 (file)
@@ -309,6 +309,26 @@ test_unset_prereq () {
 }
 
 test_set_prereq () {
+       if test -n "$GIT_TEST_FAIL_PREREQS"
+       then
+               case "$1" in
+               # The "!" case is handled below with
+               # test_unset_prereq()
+               !*)
+                       ;;
+               # (Temporary?) whitelist of things we can't easily
+               # pretend not to support
+               SYMLINKS)
+                       ;;
+               # Inspecting whether GIT_TEST_FAIL_PREREQS is on
+               # should be unaffected.
+               FAIL_PREREQS)
+                       ;;
+               *)
+                       return
+               esac
+       fi
+
        case "$1" in
        !*)
                test_unset_prereq "${1#!}"
@@ -888,6 +908,21 @@ test_cmp_rev () {
        fi
 }
 
+# Compare paths respecting core.ignoreCase
+test_cmp_fspath () {
+       if test "x$1" = "x$2"
+       then
+               return 0
+       fi
+
+       if test true != "$(git config --get --type=bool core.ignorecase)"
+       then
+               return 1
+       fi
+
+       test "x$(echo "$1" | tr A-Z a-z)" =  "x$(echo "$2" | tr A-Z a-z)"
+}
+
 # Print a sequence of integers in increasing order, either with
 # two arguments (start and end):
 #