Merge branch 'jc/compression-config'
[gitweb.git] / t / test-lib-functions.sh
index fdaeb3a96bed361f53030cb6ea5c6bdde445163f..adab7f51f4c962967c90e3184853377feece2b1e 100644 (file)
@@ -994,3 +994,17 @@ test_copy_bytes () {
                }
        ' - "$1"
 }
+
+# run "$@" inside a non-git directory
+nongit () {
+       test -d non-repo ||
+       mkdir non-repo ||
+       return 1
+
+       (
+               GIT_CEILING_DIRECTORIES=$(pwd) &&
+               export GIT_CEILING_DIRECTORIES &&
+               cd non-repo &&
+               "$@"
+       )
+}