From c72778f7c86e991045d3aa72a7296dff26d73d69 Mon Sep 17 00:00:00 2001 From: Hendrawan Kuncoro Date: Sun, 20 Oct 2024 09:39:28 +0700 Subject: [PATCH] Revert git safe dir setup --- provision/core/git/provision.sh | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/provision/core/git/provision.sh b/provision/core/git/provision.sh index 1062e9b8c..8bf7f08f4 100644 --- a/provision/core/git/provision.sh +++ b/provision/core/git/provision.sh @@ -47,20 +47,6 @@ function git_register_apt_keys() { } vvv_add_hook register_apt_keys git_register_apt_keys -# @noargs -function git_maybe_wildcard_safe_directory() { - # Extensions unable to clone without this - # Notably on Mac Silicon + Docker. Probably related to arm64 thing rather than global issue - # TODO: verify the issue on other setup, conditionally execute if it's not global - vvv_info "* Attempt to add * wildcard to vagrant git safe.directory" - ( - set -f # noglob / avoid wildcard expansion - local safe_directories=($(noroot git config --get-all safe.directory)) - local wildcard_symbol="*" - [[ " ${safe_directories[*]} " =~ " ${wildcard_symbol} " ]] && echo "* already added in git safe.directory" || ( echo "adding * wildcard to git safe directory" && noroot git config --global --add safe.directory * ) - ) -} - # @noargs function git_after_packages() { # if this setting isn't set, git will exit and provisioning will fail @@ -68,8 +54,12 @@ function git_after_packages() { vvv_info " * Git hasn't been told how to merge branches, setting pull.rebase false for the merge strategy" git config --global pull.rebase false fi + if ! noroot git config --global pull.rebase; then + vvv_info " * Git hasn't been told how to merge branches, setting pull.rebase false for the merge strategy" + noroot git config --global pull.rebase false + fi - git_maybe_wildcard_safe_directory + git config --global --add safe.directory '*' + noroot git config --global --add safe.directory '*' } - vvv_add_hook after_packages git_after_packages