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:
Jack Nagel 2011-07-30 19:32:35 -05:00 committed by Max Howell
parent 616b52e627
commit fd6c9833c6

View File

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