diff --git a/bashrc/worthwhile-functions b/bashrc/worthwhile-functions index b4d709f..e220078 100644 --- a/bashrc/worthwhile-functions +++ b/bashrc/worthwhile-functions @@ -31,10 +31,11 @@ refresh-aliases() { } # https://commentedcode.org/blog/2020/09/21/changing-default-branch-of-git-init/ -function git() { +git() { # check command for some automation KEK if [[ "$1" == "init" && "$@" != *"--help"* ]]; then - if ! command git init; then + [[ $DEBUG != "" ]] && echo "args: $@" && sleep 3 + if command git "$@"; then echo "Setting HEAD to branch main" command git symbolic-ref HEAD refs/heads/main fi