mirror of
https://github.com/shadow-maint/shadow.git
synced 2024-11-24 02:24:32 +08:00
Work around git safe.directory enforcement
Git wants to ensure that you do not read .git owned by other users. But we fetch+build as 'build' user, and run tests as root user. Those tests calculate git topdir using git rev-parse --show-toplevel, which git now fails. Setting safe.directory, seems wrong. Let's just use bash to figure out the top dir.
This commit is contained in:
parent
9cdb5251b6
commit
5a7ed86fba
@ -2,7 +2,14 @@
|
||||
|
||||
set -e
|
||||
|
||||
build_path=$(git rev-parse --show-toplevel)
|
||||
build_path=$(pwd)
|
||||
while [ "${build_path}" != "/" -a ! -d "${build_path}/.git" ]; do
|
||||
build_path=$(dirname ${build_path})
|
||||
done
|
||||
if [ ! -d "${build_path}/.git" ]; then
|
||||
echo "Not inside git directory" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Save the configuration files in tmp.
|
||||
save_config ()
|
||||
|
Loading…
Reference in New Issue
Block a user