chiark / gitweb /
Test suite: Explicitly configure user.name and user.email
[dgit.git] / tests / lib-core
index 98ae85f..7ed2761 100644 (file)
@@ -14,3 +14,23 @@ t-set-intree () {
        export DGIT_TEST 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=$(type -p git-rev-parse ||:)
+       case "$pathent" in '') return ;; esac
+       pathent=${pathent%/*}
+       local path=":$PATH:"
+       path="${path//:$pathent:/}"
+       path="${path#:}"
+       path="${path%:}"
+       PATH="$path"
+}