Prune git worktree immediately

This commit is contained in:
kjwon15 committed 2018-03-04 03:59:30 +09:00
1 parent 1025c7679f
commit af19e5e453
1 file changed
+6 -1
+6 -1
View File
@@ -41,7 +41,6 @@ git_build_app_repo() {
# unset the git quarantine path to allow us to use 2.13.0+ # unset the git quarantine path to allow us to use 2.13.0+
# See this issue for more information: https://github.com/dokku/dokku/issues/2796 # See this issue for more information: https://github.com/dokku/dokku/issues/2796
env -u GIT_QUARANTINE_PATH git worktree add "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" "$REV" > /dev/null env -u GIT_QUARANTINE_PATH git worktree add "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" "$REV" > /dev/null
trap 'rm -rf "$GIT_BUILD_APP_REPO_TMP_WORK_DIR"; git worktree prune > /dev/null' RETURN INT TERM EXIT
popd > /dev/null popd > /dev/null
pushd "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" > /dev/null pushd "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" > /dev/null
else else
@@ -65,6 +64,12 @@ git_build_app_repo() {
suppress_output git submodule update --init --recursive suppress_output git submodule update --init --recursive
find . -name .git -prune -exec rm -rf {} \; > /dev/null find . -name .git -prune -exec rm -rf {} \; > /dev/null
if use_git_worktree; then
pushd "$DOKKU_ROOT/$APP"
git worktree prune
popd
fi
local DOKKU_APP_DISABLE_ANSI_PREFIX_REMOVAL DOKKU_GLOBAL_DISABLE_ANSI_PREFIX_REMOVAL DOKKU_DISABLE_ANSI_PREFIX_REMOVAL local DOKKU_APP_DISABLE_ANSI_PREFIX_REMOVAL DOKKU_GLOBAL_DISABLE_ANSI_PREFIX_REMOVAL DOKKU_DISABLE_ANSI_PREFIX_REMOVAL
DOKKU_APP_DISABLE_ANSI_PREFIX_REMOVAL=$(config_get "$APP" DOKKU_DISABLE_ANSI_PREFIX_REMOVAL || true) DOKKU_APP_DISABLE_ANSI_PREFIX_REMOVAL=$(config_get "$APP" DOKKU_DISABLE_ANSI_PREFIX_REMOVAL || true)
DOKKU_GLOBAL_DISABLE_ANSI_PREFIX_REMOVAL=$(config_get --global DOKKU_DISABLE_ANSI_PREFIX_REMOVAL || true) DOKKU_GLOBAL_DISABLE_ANSI_PREFIX_REMOVAL=$(config_get --global DOKKU_DISABLE_ANSI_PREFIX_REMOVAL || true)