This repository was archived by the owner on Jan 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -7,26 +7,36 @@ git() {
77}
88
99git_init_if_necessary () {
10+ if [[ -n " $HOMEBREW_OSX " ]]
11+ then
12+ OFFICIAL_REMOTE=" https://github.com/Homebrew/brew.git"
13+ else
14+ OFFICIAL_REMOTE=" https://github.com/Linuxbrew/brew.git"
15+ fi
16+
1017 if [[ ! -d " .git" ]]
1118 then
1219 set -e
1320 trap ' { rm -rf .git; exit 1; }' EXIT
1421 git init
1522 git config --bool core.autocrlf false
16- git config remote.origin.url https://github.com/Homebrew/homebrew.git
23+ git config remote.origin.url " $OFFICIAL_REMOTE "
1724 git config remote.origin.fetch " +refs/heads/*:refs/remotes/origin/*"
1825 git fetch --force --depth=1 origin refs/heads/master:refs/remotes/origin/master
1926 git reset --hard origin/master
2027 SKIP_FETCH_HOMEBREW_REPOSITORY=1
2128 set +e
2229 trap - EXIT
23- return
24- fi
25-
26- if [[ " $( git remote show origin -n) " = * " mxcl/homebrew" * ]]
27- then
28- git remote set-url origin https://github.com/Homebrew/homebrew.git &&
29- git remote set-url --delete origin " .*mxcl\/homebrew.*"
30+ else
31+ set -e
32+ git config --bool core.autocrlf false
33+ git config --replace-all remote.origin.url " $OFFICIAL_REMOTE "
34+ git config remote.origin.fetch " +refs/heads/*:refs/remotes/origin/*"
35+ git fetch --force --depth=1 origin refs/heads/master:refs/remotes/origin/master
36+ git reset --hard origin/master
37+ git gc --auto
38+ SKIP_FETCH_HOMEBREW_REPOSITORY=1
39+ set +e
3040 fi
3141}
3242
You can’t perform that action at this time.
0 commit comments