diff options
Diffstat (limited to 't/test-lib-functions.sh')
| -rw-r--r-- | t/test-lib-functions.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 579e812506..bd357704cc 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1004,3 +1004,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 && + "$@" + ) +} |
