From 326c6ea00146d57a5c86a54377b061f4bdf4d8c0 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 6 Jun 2022 20:05:05 +0200 Subject: [PATCH] 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 --- git_helpers | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git_helpers b/git_helpers index 1d07853..3684dfa 100755 --- a/git_helpers +++ b/git_helpers @@ -82,9 +82,13 @@ 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" - cd - ; return 0 + 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 @@ -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