create workspace in any case

This commit is contained in:
Gerhard Hoffmann 2022-06-09 21:18:38 +02:00
parent da3c9abbf5
commit 966a779065

View File

@ -71,9 +71,7 @@ revert_to_commit_before_pull () {
clone_customer_repository () {
local func="${FUNCNAME[0]}"
if [ "$PWD" = "$WORKING_DIRECTORY" ]; then
if ! [[ -d "./$WORKSPACE_DIR" ]]; then
{ mkdir -p ./$WORKSPACE_DIR; }
fi
mkdir -p "./$WORKSPACE_DIR"
# check if the directory is empty. If so, clone the
# customer repository
if ! find ./$WORKSPACE_DIR -mindepth 1 -maxdepth 1 | read; then
@ -88,8 +86,9 @@ clone_customer_repository () {
# a "git pull" will automatically fetched files in the
# corresponding sytem-folders.
if cd ${CUSTOMER_ID_BASE_DIR}; then
local res=$(exec_git_command git --git-dir=.git --work-tree=/ init)
if ! [[ -z $res ]]; then
# local res=$(exec_git_command git --git-dir=.git --work-tree=/ init)
exec_git_command git config core.worktree "/"
if [[ $? -eq 0 ]]; then
# re-initialized. copy post-merge (a hook called
# when 'git pull' is executed and changed data
# are received).