chiark / gitweb /
git-playtree-setup: Rename from git-playtree-create
[dgit.git] / tests / lib-core
1 #
2
3 fail () {
4         echo >&2 "failed: $*"
5         exit 1
6 }
7
8 t-set-intree () {
9         if [ "x$DGIT_TEST_INTREE" = x ]; then return; fi
10         : ${DGIT_TEST:=$DGIT_TEST_INTREE/dgit}
11         : ${DGIT_BADCOMMIT_FIXUP:=$DGIT_TEST_INTREE/dgit-badcommit-fixup}
12         : ${DGIT_REPOS_SERVER_TEST:=$DGIT_TEST_INTREE/infra/dgit-repos-server}
13         : ${DGIT_SSH_DISPATCH_TEST:=$DGIT_TEST_INTREE/infra/dgit-ssh-dispatch}
14         : ${DGIT_DEBPUSH_TEST:=$DGIT_TEST_INTREE/git-debpush}
15         : ${DGIT_INFRA_PFX:=$DGIT_TEST_INTREE${DGIT_TEST_INTREE:+/infra/}}
16         : ${DGIT_GITDEBREBASE_TEST:=$DGIT_TEST_INTREE/git-debrebase}
17         : ${DGIT_MANPAGES_SOURCE_DIR:=$DGIT_TEST_INTREE}
18         : ${DEBPUSH_GIT_PLAYTREE_SETUP:=$DGIT_TEST_INTREE/git-playtree-setup}
19         export DGIT_TEST DGIT_BADCOMMIT_FIXUP
20         export DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST
21         export DGIT_MANPAGES_SOURCE_DIR DEBPUSH_GIT_PLAYTREE_SETUP
22         export PERLLIB="$DGIT_TEST_INTREE${PERLLIB:+:}${PERLLIB}"
23 }
24
25 t-set-using-tmp () {
26         export HOME=$tmp
27         export DGIT_TEST_DUMMY_DIR=$tmp
28         export DGIT_TEST_TMP=$tmp
29         export GNUPGHOME=$tmp/nonexistent
30         export DEBFULLNAME='dgit test git user'
31         git config --global user.email 'dgit-test@debian.example.net'
32         git config --global user.name "$DEBFULLNAME"
33         git config --global protocol.ext.allow always
34 }
35
36 t-filter-out-git-hyphen-dir () {
37         local pathent; pathent=$(type -p git-rev-parse ||:)
38         case "$pathent" in '') return ;; esac
39         pathent=${pathent%/*}
40         local path=":$PATH:"
41         path="${path//:$pathent:/}"
42         path="${path#:}"
43         path="${path%:}"
44         PATH="$path"
45 }
46
47 t-sort () {
48         LC_COLLATE=C sort "$@"
49 }