1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-21 19:46:09 +02:00

ci/lib-docker: preserve required environment variables

We're using "su -m" to preserve environment variables in the shell run
by "su". But, that options will be ignored while "-l" (aka "--login") is
specified in util-linux and busybox's su.

In a later patch this script will be reused for checking Git for Linux
with musl libc on Alpine Linux, Alpine Linux uses "su" from busybox.

Since we don't have interest in all environment variables,
pass only those necessary variables to the inner script.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Đoàn Trần Công Danh 2020-04-04 08:08:46 +07:00 committed by Junio C Hamano
parent d2fae19e0f
commit ffce2ebdd9

View File

@ -51,10 +51,17 @@ else
fi
# Build and test
linux32 --32bit i386 su -m -l $CI_USER -c '
linux32 --32bit i386 su -m -l $CI_USER -c "
set -ex
export DEVELOPER='$DEVELOPER'
export DEFAULT_TEST_TARGET='$DEFAULT_TEST_TARGET'
export GIT_PROVE_OPTS='$GIT_PROVE_OPTS'
export GIT_TEST_OPTS='$GIT_TEST_OPTS'
export GIT_TEST_CLONE_2GB='$GIT_TEST_CLONE_2GB'
export MAKEFLAGS='$MAKEFLAGS'
export cache_dir='$cache_dir'
cd /usr/src/git
test -n "$cache_dir" && ln -s "$cache_dir/.prove" t/.prove
test -n '$cache_dir' && ln -s '$cache_dir/.prove' t/.prove
make
make test
'
"