1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#
fail () {
echo >&2 "failed: $*"
exit 1
}
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_MIRROR_SSH_WRAP_TEST:=$DGIT_TEST_INTREE/infra/dgit-mirror-ssh-wrap}
: ${DGIT_DEBPUSH_TEST:=$DGIT_TEST_INTREE/git-debpush}
: ${DGIT_INFRA_PFX:=$DGIT_TEST_INTREE${DGIT_TEST_INTREE:+/infra/}}
: ${DGIT_GITDEBREBASE_TEST:=$DGIT_TEST_INTREE/git-debrebase}
: ${DGIT_MANPAGES_SOURCE_DIR:=$DGIT_TEST_INTREE}
: ${DEBPUSH_GIT_PLAYTREE_SETUP:=$DGIT_TEST_INTREE/git-playtree-setup}
export DGIT_TEST DGIT_BADCOMMIT_FIXUP
export DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST
export DGIT_MIRROR_SSH_WRAP_TEST
export DGIT_MANPAGES_SOURCE_DIR DEBPUSH_GIT_PLAYTREE_SETUP
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
export DEBFULLNAME='dgit test git user'
git config --global user.email 'dgit-test@debian.example.net'
git config --global user.name "$DEBFULLNAME"
git config --global protocol.ext.allow always
git config --global dgit.default.push-subcmd reject
}
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"
}
t-sort () {
LC_COLLATE=C sort "$@"
}
|