From fd6c9833c68c666d55195e208f81d616c149d00d Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 30 Jul 2011 19:32:35 -0500 Subject: [PATCH] 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. --- Library/Homebrew/cmd/update.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index 599a9998c7..c225b91761 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -42,7 +42,7 @@ class RefreshBrew begin safe_system "git init" safe_system "git fetch #{REPOSITORY_URL}" - safe_system "git reset FETCH_HEAD" + safe_system "git reset --soft FETCH_HEAD" rescue Exception safe_system "rm -rf .git" raise