mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
Fix brew update
local changes bug
Users were seeing local changes in their repository after updating, even though they had made no local changes. The repository setup sequence should use `git reset --soft` rather than vanilla `git reset`, which defaults to '--mixed'. '--soft' updates _only_ HEAD, leaving the index as-is, allowing future incantations of `brew update` to proceed without errors. Fixes Homebrew/homebrew#6732.
This commit is contained in:
parent
616b52e627
commit
fd6c9833c6
@ -42,7 +42,7 @@ class RefreshBrew
|
|||||||
begin
|
begin
|
||||||
safe_system "git init"
|
safe_system "git init"
|
||||||
safe_system "git fetch #{REPOSITORY_URL}"
|
safe_system "git fetch #{REPOSITORY_URL}"
|
||||||
safe_system "git reset FETCH_HEAD"
|
safe_system "git reset --soft FETCH_HEAD"
|
||||||
rescue Exception
|
rescue Exception
|
||||||
safe_system "rm -rf .git"
|
safe_system "rm -rf .git"
|
||||||
raise
|
raise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user