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