From 966a7790650ba852739a95be35fc5d68ab64e760 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 9 Jun 2022 21:18:38 +0200 Subject: [PATCH] create workspace in any case --- git_helpers | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/git_helpers b/git_helpers index 798f049..19bbf74 100755 --- a/git_helpers +++ b/git_helpers @@ -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).