quick fix an small bug in git init stuff

Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
Andrei Jiroh Eugenio Halili 2021-08-15 22:09:54 +08:00
parent d95dfa7fc8
commit f35a5f618b
Signed by: ajhalili2006
GPG Key ID: A30EBE40AD856D88
1 changed files with 3 additions and 2 deletions

View File

@ -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