quick fix an small bug in git init stuff
Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
parent
d95dfa7fc8
commit
f35a5f618b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue