X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=tests%2Flib-core;h=6cdffeb155a479288124a98d9e613016c04b4dcb;hb=2ecbfc70bba339e0475b745f5d5615675e427370;hp=98ae85f5e8d1026ec5c6180fe47e8fabf8425588;hpb=6913c854ca0f3eb901c39c74b74d7f0344318f72;p=dgit.git diff --git a/tests/lib-core b/tests/lib-core index 98ae85f5..6cdffeb1 100644 --- a/tests/lib-core +++ b/tests/lib-core @@ -8,9 +8,31 @@ fail () { t-set-intree () { if [ "x$DGIT_TEST_INTREE" = x ]; then return; fi : ${DGIT_TEST:=$DGIT_TEST_INTREE/dgit} + : ${DGIT_BADCOMMIT_FIXUP:=$DGIT_TEST_INTREE/dgit-badcommit-fixup} : ${DGIT_REPOS_SERVER_TEST:=$DGIT_TEST_INTREE/infra/dgit-repos-server} : ${DGIT_SSH_DISPATCH_TEST:=$DGIT_TEST_INTREE/infra/dgit-ssh-dispatch} : ${DGIT_INFRA_PFX:=$DGIT_TEST_INTREE${DGIT_TEST_INTREE:+/infra/}} - export DGIT_TEST DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST + export DGIT_TEST DGIT_BADCOMMIT_FIXUP + export DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST export PERLLIB="$DGIT_TEST_INTREE${PERLLIB:+:}${PERLLIB}" } + +t-set-using-tmp () { + export HOME=$tmp + export DGIT_TEST_DUMMY_DIR=$tmp + export DGIT_TEST_TMP=$tmp + export GNUPGHOME=$tmp/nonexistent + git config --global user.email 'dgit-test@debian.example.net' + git config --global user.name 'dgit test git user' +} + +t-filter-out-git-hyphen-dir () { + local pathent; pathent=$(type -p git-rev-parse ||:) + case "$pathent" in '') return ;; esac + pathent=${pathent%/*} + local path=":$PATH:" + path="${path//:$pathent:/}" + path="${path#:}" + path="${path%:}" + PATH="$path" +}