From f35a5f618bb03d9549aaf8c5a94a19ea7d9ddefe Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Eugenio Halili Date: Sun, 15 Aug 2021 22:09:54 +0800 Subject: [PATCH] quick fix an small bug in git init stuff Signed-off-by: Andrei Jiroh Eugenio Halili --- bashrc/worthwhile-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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