From 9f64fdb9b6fe557072f01c1adce13ae93b2b3834 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Sep 2017 14:10:47 -0400 Subject: [PATCH] fix: Change to app directory when calling git worktree add Closes #2864 --- plugins/git/functions | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/functions b/plugins/git/functions index d5a972c70..37eeea70b 100755 --- a/plugins/git/functions +++ b/plugins/git/functions @@ -37,7 +37,9 @@ git_build_app_repo() { if use_git_worktree; then # git worktree - this method uses git worktree which was introduced in git 2.5 + pushd "$DOKKU_ROOT/$APP" > /dev/null git worktree add "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" "$REV" > /dev/null + popd > /dev/null pushd "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" > /dev/null else # git clone - this method creates a new git repository and adds the primary