Merge pull request #747 from ZhongRuoyu/git-init-default-branch

install.sh: ensure `master` is used for `git init`
This commit is contained in:
Mike McQuaid
2023-02-23 08:55:40 +00:00
committed by GitHub

View File

@@ -887,7 +887,7 @@ ohai "Downloading and installing Homebrew..."
cd "${HOMEBREW_REPOSITORY}" >/dev/null || return
# we do it in four steps to avoid merge errors when reinstalling
execute "git" "init" "-q"
execute "git" "init" "--quiet" "--initial-branch" "master"
# "git remote add" will fail if the remote is defined in the global config
execute "git" "config" "remote.origin.url" "${HOMEBREW_BREW_GIT_REMOTE}"
@@ -923,7 +923,7 @@ ohai "Downloading and installing Homebrew..."
execute "${MKDIR[@]}" "${HOMEBREW_CORE}"
cd "${HOMEBREW_CORE}" >/dev/null || return
execute "git" "init" "-q"
execute "git" "init" "--quiet" "--initial-branch" "master"
execute "git" "config" "remote.origin.url" "${HOMEBREW_CORE_GIT_REMOTE}"
execute "git" "config" "remote.origin.fetch" "+refs/heads/*:refs/remotes/origin/*"
execute "git" "config" "--bool" "core.autocrlf" "false"