We use a different work-tree as usual when creatinng the repository.

Cloning the rep. does not save this setting. So we have to re-init the
rep:

git --git-dir=.git --work-tree=/ init
This commit is contained in:
Gerhard Hoffmann 2022-06-06 20:05:05 +02:00
parent 66511262e1
commit 326c6ea001

View File

@ -82,10 +82,14 @@ clone_customer_repository () {
then
$(exec_git_command git clone "$1")
if [ $? -eq 0 ]; then
CLONE_CUSTOMER_REPOSITORY=true
log_debug "$func:${LINENO} cloning ${1} done"
local res=$(exec_git_command git --git-dir="${CUSTOMER_ID_BASE_DIR}/.git" --work-tree="/" init)
if ! [[ -z $res ]]; then
CLONE_CUSTOMER_REPOSITORY=true
log_debug "$func:${LINENO} re-init of ${1} done"
cd -; return 0
fi
fi
cd -
fi
else
@ -111,6 +115,7 @@ clone_customer_repository () {
cd_customer_repository () {
local func="${FUNCNAME[0]}"
# has to be called in WORKING_DIRECTORY
cd "$WORKING_DIRECTORY"
if [ "$PWD" = "${WORKING_DIRECTORY}" ]; then
repository_dir="./$WORKSPACE_DIR/$CUSTOMER_ID"
if ! [[ -d "$repository_dir" ]]; then